mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-30 12:06:56 +00:00
doc(filter): add example of filter without for use
This commit is contained in:
committed by
Fabien Potencier
parent
2a8fa63690
commit
847276a6b9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user