mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 02:16:41 +00:00
Fix mistake in docs for keys filter
This commit is contained in:
committed by
Fabien Potencier
parent
75751250cc
commit
deb37c30c4
@@ -6,10 +6,10 @@ when you want to iterate over the keys of a sequence or a mapping:
|
||||
|
||||
.. code-block:: twig
|
||||
|
||||
{% for key in [1, 2, 3, 4]|keys %}
|
||||
{% for key in ['a', 'b', 'c', 'd']|keys %}
|
||||
{{ key }}
|
||||
{% endfor %}
|
||||
{# outputs: 1 2 3 4 #}
|
||||
{# outputs: 0 1 2 3 #}
|
||||
|
||||
{% for key in {a: 'a_value', b: 'b_value'}|keys %}
|
||||
{{ key }}
|
||||
|
||||
Reference in New Issue
Block a user