Skip to content

Update stream-everything.md #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2022
Merged

Conversation

zalesak
Copy link
Contributor

@zalesak zalesak commented Mar 31, 2022

Example is not functional.

@@ -96,7 +96,7 @@ In `symfony/ux-turbo` 2.1 and higher, this code has changed:

```php
if (TurboBundle::STREAM_FORMAT === $request->getPreferredFormat()) {
$request->setFormat(TurboBundle::STREAM_FORMAT);
$request->setRequestFormat(TurboBundle::STREAM_FORMAT);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I'm not sure about this change. I suppose the example was taken from the official docs: https://symfony.com/bundles/ux-turbo/current/index.html#forms - there we have $request->setFormat(TurboBundle::STREAM_FORMAT);. If it does not work - then it should be fixed upstream in the Symfony docs as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not working, there are several issues about it on symfony github, as well as pull requests.

symfony/ux#297

/**
 * Associates a format with mime types.
 * /
public function setFormat(?string $format, $mimeTypes)

/**
 * Sets the request format.
*/
public function setRequestFormat(?string $format)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I see it, you're right! And it seems it was already fixed upstream in the docs I referenced above 👍

@bocharsky-bw
Copy link
Member

Thank you for this fix! I'm merging this now, later the video note also will be tweaked

@bocharsky-bw bocharsky-bw merged commit 8114d67 into SymfonyCasts:main Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants