mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-25 01:29:38 +00:00
f99eab8541
This PR was merged into the 3.x branch.
Discussion
----------
Add a way to stream template rendering
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:
```php
use Symfony\Component\HttpFoundation\StreamedResponse;
use Twig\Environment;
$twig = new Environment(/* ... */);
$response = new StreamedResponse($twig->load('index')->stream([]));
$response->send();
```
Commits
-------
1915ee2812 Add a way to stream template rendering