minor #4531 Add a note on the types locality (fabpot)

This PR was merged into the 3.x branch.

Discussion
----------

Add a note on the types locality

For your information `@drjayvee` `@ruudk`

Commits
-------

e7ae984e36 Add a note on the types locality
This commit is contained in:
Fabien Potencier
2025-01-04 09:42:25 +01:00
+7
View File
@@ -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.