Skip to content

Commit 3efe4dc

Browse files
committed
added a tip about how to register a Twig extension
1 parent 12923f5 commit 3efe4dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

book/templating.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ it:
9393
Twig comes with a long list of `tags`_ and `filters`_ that are available
9494
by default. You can even `add your own extensions`_ to Twig as needed.
9595

96+
.. tip::
97+
98+
Registering a Twig extension is an easy as creating a new service and tag
99+
it with ``twig.extension`` :ref:`tag<book-service-container-tags>`.
100+
96101
As you'll see throughout the documentation, Twig also supports functions
97102
and new functions can be easily added. For example, the following uses a
98103
standard ``if`` tag and the ``cycle`` function to print ten div tags, with

0 commit comments

Comments
 (0)