-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
[TwigComponent] two levels of nesting do not work #1954
Comments
First thing: I'm not sure you should create a Twig component for your entire body. In your layout.html.twig, you use a block "body" than you never defined... The twig:Body component is a .. component, and the fact it could work calling it body is nothing documented, and that could change at any time. Is there any reason here that prevent you to use standard twig blocks ? |
Its not about component Body. Its only simulation of problem. But In my aplication have similar component Layout where I want have logic which layout I want use. So aproach is similar and problem is same. And why im using components? I want build universal template for all my projects. I think components are suitable for this. So should I take it as saying that this cannot be done with twig components? |
Just saying you have no outer blocks in this template. so this wont work.
I'm saying this is much easier with twig regular blocks / extends / embeds... Twig is the perfect tool to build layout structures with inheritence, etc... TwigComponents are made to have PHP-based capabilities in an isolated scope. |
But i like props in twig comnponents. With it I can simply modify the view. I dont need to remmember all classes, just set the props and everything in template is hapening. But thanks for your time, I will switch to classic blocks |
Hi,
I have this situation:
When i want render
index.html.twig
thencontainer
block is not renderedAny idea how to render this block ?
Thanks
The text was updated successfully, but these errors were encountered: