mirror of
https://github.com/twigphp/Twig.git
synced 2026-11-02 00:55:23 +00:00
17 lines
363 B
ReStructuredText
17 lines
363 B
ReStructuredText
``invoke``
|
|
==========
|
|
|
|
.. versionadded:: 3.19
|
|
|
|
The ``invoke`` filter has been added in Twig 3.19.
|
|
|
|
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 #}
|