mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-30 20:16:45 +00:00
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:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user