include 标签和 include 函数有什么区别?
What's the difference between the include tag and the include function?
我看到有人使用 twig 模板系统在他的应用程序中包含了一个模板。
他包含了这样的模板:
{{ include( 'Bundlename:Directory:template.html.twig' ) }}
而不是这个:
{% include 'Bundlename:Directory:template.html.twig' %}
起初我以为他使用的是自定义的树枝扩展,但实际上
一般在 symfony 上工作,即使它没有记录。
http://twig.sensiolabs.org/doc/tags/include.html
那么这两者有区别吗?
为什么没有记录在案?
如果语法错误,为什么它还能工作?
已记录 http://twig.sensiolabs.org/doc/functions/include.html。
Twig tag include vs function include
我看到有人使用 twig 模板系统在他的应用程序中包含了一个模板。 他包含了这样的模板:
{{ include( 'Bundlename:Directory:template.html.twig' ) }}
而不是这个:
{% include 'Bundlename:Directory:template.html.twig' %}
起初我以为他使用的是自定义的树枝扩展,但实际上 一般在 symfony 上工作,即使它没有记录。
http://twig.sensiolabs.org/doc/tags/include.html
那么这两者有区别吗? 为什么没有记录在案? 如果语法错误,为什么它还能工作?
已记录 http://twig.sensiolabs.org/doc/functions/include.html。
Twig tag include vs function include