We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5201f54 commit 3f8c934Copy full SHA for 3f8c934
sfcasts/turbo/stream-everything.md
@@ -91,6 +91,20 @@ for that in the controller.
91
Here's how it looks: wrap our stream render with if
92
`TurboStreamResponse::STREAM_FORMAT` equals `$request->getPreferredFormat()`.
93
94
+***TIP
95
+In symfony/ux-turbo 2.1 and higher, this code has changed:
96
+
97
+```php
98
+if (TurboBundle::STREAM_FORMAT === $request->getPreferredFormat()) {
99
+ $request->setFormat(TurboBundle::STREAM_FORMAT);
100
101
+ return $this->render('product/reviews.stream.html.twig', [
102
+ 'product' => $product,
103
+ ]);
104
+}
105
+```
106
+***
107
108
[[[ code('eaa99b1e97') ]]]
109
110
That's it. This preferred format thing basically looks at the `Accept` request header
0 commit comments