Lines Matching refs:block
1 ``block``
5 Using ``block`` with the ``defined`` test was added in Twig 1.28.
10 When a template uses inheritance and if you want to print a block multiple
11 times, use the ``block`` function:
13 .. code-block:: jinja
15 <title>{% block title %}{% endblock %}</title>
17 <h1>{{ block('title') }}</h1>
19 {% block body %}{% endblock %}
21 The ``block`` function can also be used to display one block from another
24 .. code-block:: jinja
26 {{ block("title", "common_blocks.twig") }}
28 Use the ``defined`` test to check if a block exists in the context of the
31 .. code-block:: jinja
33 {% if block("footer") is defined %}
37 {% if block("footer", "common_blocks.twig") is defined %}