mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-17 04:46:49 +00:00
Add a note on the types locality
This commit is contained in:
@@ -8,6 +8,13 @@
|
|||||||
|
|
||||||
The ``types`` tag declares the types of template variables.
|
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
|
To do this, specify a :ref:`mapping <twig-expressions>` of names to their types
|
||||||
as strings.
|
as strings.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user