Skip to content

Commit

Permalink
Finish the work
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 12, 2025
1 parent c4fd25f commit 3e93e91
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# 3.19.0 (2025-XX-XX)

* Add `LastModifiedExtensionInterface` and implementation in `AbstractExtension` to track modification of runtime classes
* Add the `invoke` filter
* Make `{}` optional for the `types` tag
* Add `LastModifiedExtensionInterface` and implementation in `AbstractExtension` to track modification of runtime classes
Expand Down
11 changes: 4 additions & 7 deletions doc/filters/invoke.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
``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
Expand All @@ -10,10 +14,3 @@ The ``invoke`` filter invokes an arrow function with the given arguments:
{{ func|invoke(person) }}
{# outputs Bob Smith #}
Note that the arrow function has access to the current context.

Arguments
---------

All given arguments are passed to the arrow function.
3 changes: 2 additions & 1 deletion doc/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,8 @@ The following operators don't fit into any of the other categories:
Arrow function support for functions, macros, and method calls was added in
Twig 3.15 (filters and tests were already supported).

Arrow functions can be called using the ``invoke`` filter:
Arrow functions can be called using the :doc:`invoke </filters/invoke>`
filter.

.. versionadded:: 3.19

Expand Down

0 comments on commit 3e93e91

Please sign in to comment.