pico/lib/twig/doc/functions/block.rst
Gilbert Pellegrom 92b792e8f2 Initial commit.
2012-04-04 14:45:09 +01:00

16 lines
359 B
ReStructuredText
Executable File

``block``
=========
When a template uses inheritance and if you want to print a block multiple
times, use the ``block`` function:
.. code-block:: jinja
<title>{% block title %}{% endblock %}</title>
<h1>{{ block('title') }}</h1>
{% block body %}{% endblock %}
.. seealso:: :doc:`extends<../tags/extends>`, :doc:`parent<../functions/parent>`