diff options
Diffstat (limited to 'vendor/twig/twig/doc/functions/attribute.rst')
-rw-r--r-- | vendor/twig/twig/doc/functions/attribute.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vendor/twig/twig/doc/functions/attribute.rst b/vendor/twig/twig/doc/functions/attribute.rst new file mode 100644 index 00000000..3051bdaa --- /dev/null +++ b/vendor/twig/twig/doc/functions/attribute.rst | |||
@@ -0,0 +1,18 @@ | |||
1 | ``attribute`` | ||
2 | ============= | ||
3 | |||
4 | .. versionadded:: 1.2 | ||
5 | The ``attribute`` function was added in Twig 1.2. | ||
6 | |||
7 | ``attribute`` can be used to access a "dynamic" attribute of a variable: | ||
8 | |||
9 | .. code-block:: jinja | ||
10 | |||
11 | {{ attribute(object, method) }} | ||
12 | {{ attribute(object, method, arguments) }} | ||
13 | {{ attribute(array, item) }} | ||
14 | |||
15 | .. note:: | ||
16 | |||
17 | The resolution algorithm is the same as the one used for the ``.`` | ||
18 | notation, except that the item can be any valid expression. | ||