Skip to content

Commit

Permalink
minor #4531 Add a note on the types locality (fabpot)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.x branch.

Discussion
----------

Add a note on the types locality

For your information `@drjayvee` `@ruudk`

Commits
-------

e7ae984 Add a note on the types locality
  • Loading branch information
fabpot committed Jan 4, 2025
2 parents 5dd37d8 + e7ae984 commit 8689d46
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/tags/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

The ``types`` tag declares the types of template variables.

.. note::

The types declared in a template are local to that template and must not be
propagated to included templates. This is because a template can be
included from multiple different places, each potentially having different
variable types.

To do this, specify a :ref:`mapping <twig-expressions>` of names to their types
as strings.

Expand Down

0 comments on commit 8689d46

Please sign in to comment.