-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[TwigBridge] Render a block via the #[Template] attribute
#58028
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
Conversation
|
Make a test using an actual Twig instance, with a template that has a |
|
Thank you @stof!
had to remove the error tag (kept some ERROR text)... as the parsing of the tag made compilation fail. |
|
ah sorry. We don't have the |
|
Thank you for the help ;) |
18264ea to
14d4316
Compare
|
Thank you @smnandre. |
…ate]` attribute (smnandre) This PR was squashed before being merged into the 7.2 branch. Discussion ---------- [Templating] [Template] Render a block with the `#[Template]` attribute Document [symfony/symfony#58028](symfony/symfony#58028) and closes #20123 Commits ------- d883d56 [Templating] [Template] Render a block with the `#[Template]` attribute
The same way
renderBlockwas added in the AbstractController, and for the same reasons, this PR adds ablockparameter on the Template attribute, used by the TemplateAttributeListener.Example taken from the documentation
With this PR
🛟 Only problem here, i don't get how to test this properly..
Twig\Templateis abstract,Twig\TemplateWrapperis final, andEnvironment::load()must return aTemplateWrapper..I looked at the AbstractController tests but i don't find one covering the load->displayBlock / load->renderBlock.