diff options
Diffstat (limited to 'vendor/twig/twig/doc/functions/block.rst')
-rw-r--r-- | vendor/twig/twig/doc/functions/block.rst | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/twig/twig/doc/functions/block.rst b/vendor/twig/twig/doc/functions/block.rst new file mode 100644 index 00000000..fd571efb --- /dev/null +++ b/vendor/twig/twig/doc/functions/block.rst | |||
@@ -0,0 +1,15 @@ | |||
1 | ``block`` | ||
2 | ========= | ||
3 | |||
4 | When a template uses inheritance and if you want to print a block multiple | ||
5 | times, use the ``block`` function: | ||
6 | |||
7 | .. code-block:: jinja | ||
8 | |||
9 | <title>{% block title %}{% endblock %}</title> | ||
10 | |||
11 | <h1>{{ block('title') }}</h1> | ||
12 | |||
13 | {% block body %}{% endblock %} | ||
14 | |||
15 | .. seealso:: :doc:`extends<../tags/extends>`, :doc:`parent<../functions/parent>` | ||