mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 12:26:30 +00:00
tweaked some docs
This commit is contained in:
+12
-5
@@ -20,17 +20,24 @@ of that file:
|
|||||||
template outputs its rendered contents in the current scope; a tag should
|
template outputs its rendered contents in the current scope; a tag should
|
||||||
not display anything);
|
not display anything);
|
||||||
|
|
||||||
* The rendered template can be more easily stored in a variable when using
|
* The ``include`` function is more "composable":
|
||||||
the ``include`` function:
|
|
||||||
|
|
||||||
.. code-block:: jinja
|
.. code-block:: jinja
|
||||||
|
|
||||||
{% set content %}{% include 'template.html' %}{% endset %}
|
{# Store a rendered template in a variable #}
|
||||||
|
{% set content %}
|
||||||
|
{% include 'template.html' %}
|
||||||
|
{% endset %}
|
||||||
{# vs #}
|
{# vs #}
|
||||||
|
|
||||||
{% set content = include('template.html') %}
|
{% set content = include('template.html') %}
|
||||||
|
|
||||||
|
{# Filter a rendered template #}
|
||||||
|
{% filter upper %}
|
||||||
|
{% include 'template.html' %}
|
||||||
|
{% endfilter %}
|
||||||
|
{# vs #}
|
||||||
|
{% include('template.html')|upper %}
|
||||||
|
|
||||||
* The ``include`` function does not impose any specific order for
|
* The ``include`` function does not impose any specific order for
|
||||||
arguments thanks to :ref:`named arguments <named-arguments>`.
|
arguments thanks to :ref:`named arguments <named-arguments>`.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user