-
Notifications
You must be signed in to change notification settings - Fork 168
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
How to access renderBlock method? #35
Comments
The Twig Template class It's therefore not an instance you will have access to through the normal View facade. Can I ask what your trying todo? |
Thanks. I have bunch of blocks in my twig templates. For example:
If I detect an AJAX request, I'd like to render only that particular block and return to client. Also, there are useful methods like hasBlock, renderParentBlock, etc. that I'd like to access for other purposes and I'm not sure how. |
Couple of ways you can do the ajax stuff:
Maybe even checkout Turbo :p Access to the generated class isn't something that TwigBridge is likely to provide for you. More than welcome to provide a pull request if you manage to do so. |
I do it like this now:
It works but render time increases from 15ms to 83ms when I run a test. displayBlock() shaves a couple of ms. |
Hi, I'd like to use the following method from Twig's
\vendor\twig\twig\lib\Twig\Template.php
;public function renderBlock($name, array $context, array $blocks = array())
The following doesn't work:
Thanks.
The text was updated successfully, but these errors were encountered: