-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add a way to stream template rendering #4504
Conversation
I thought about streaming blocks as well, but I'm not sure this is worth it. |
This will allow us to improve this method https://github.com/symfony/symfony/blob/7.3/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php#L267 👍
I think yes, since there is a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will you add a helper Twig\Environment::stream()
as well?
a53048b
to
3ea5fdf
Compare
And it's used via the #[Template] attribute too. |
And this will probably allow some decent optimizations in the TwigEngineRenderer / block systems :) |
3ea5fdf
to
1915ee2
Compare
I've just added a |
No, I don't think this is needed. The Environment class has already too many methods. I would like to do the opposite actually and deprecate the |
Even if we're using
yield
internally, there is no easy way to stream template rendering. This new method can be used like this to HTTP stream a template with Symfony: