gmarche/vendor/twig/twig/doc/filters/keys.rst

12 lines
218 B
ReStructuredText

``keys``
========
The ``keys`` filter returns the keys of an array. It is useful when you want to
iterate over the keys of an array:
.. code-block:: twig
{% for key in array|keys %}
...
{% endfor %}