mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-19 13:57:00 +00:00
13 lines
283 B
ReStructuredText
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 #}
|