Files
Twig/doc/filters/invoke.rst
2025-03-21 10:09:05 +01:00

13 lines
283 B
ReStructuredText

``invoke``
==========
The ``invoke`` filter invokes an arrow function with the given arguments:
.. code-block:: twig
{% set person = { first: "Bob", last: "Smith" } %}
{% set func = p => "#{p.first} #{p.last}" %}
{{ func|invoke(person) }}
{# outputs Bob Smith #}