Reputation: 1539
I saw someone including a template on his application using the twig template system. He included his template like this:
{{ include( 'Bundlename:Directory:template.html.twig' ) }}
instead of this:
{% include 'Bundlename:Directory:template.html.twig' %}
At first I thought he was using a custom twig extension, but it actually works on symfony in general, even though its not documented.
http://twig.sensiolabs.org/doc/tags/include.html
So is there a difference between the two? why is it not documented? if the syntax is wrong why is it even working?
Upvotes: 2
Views: 288
Reputation: 4310
It is documented http://twig.sensiolabs.org/doc/functions/include.html.
Twig tag include vs function include
Upvotes: 4