doc(filter): add example of filter without for use

This commit is contained in:
Hugo Alliaume
2019-05-20 09:05:23 +02:00
committed by Fabien Potencier
parent 2a8fa63690
commit 847276a6b9
+3
View File
@@ -29,6 +29,9 @@ function. The arrow function receives the value of the sequence or mapping:
{% endfor %}
{# output l = 40 xl = 42 #}
{{ sizes|filter(v => v > 38)|join(', ') }}
{# output 40, 42 #}
The arrow function also receives the key as a second argument:
.. code-block:: twig