Fix mistake in docs for keys filter

This commit is contained in:
Ruud Kamphuis
2024-11-02 15:38:17 +01:00
committed by Fabien Potencier
parent 75751250cc
commit deb37c30c4
+2 -2
View File
@@ -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 }}