From 3e93e91f5971b8f01627663993220b7d48c80c63 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 12 Jan 2025 18:48:19 +0100 Subject: [PATCH] Finish the work --- CHANGELOG | 1 - doc/filters/invoke.rst | 11 ++++------- doc/templates.rst | 3 ++- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index bd7dcb57e5..5b01ea7ffb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/doc/filters/invoke.rst b/doc/filters/invoke.rst index 71dc5349db..b8e1a4936b 100644 --- a/doc/filters/invoke.rst +++ b/doc/filters/invoke.rst @@ -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 @@ -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. diff --git a/doc/templates.rst b/doc/templates.rst index 822f3f8319..7bf2d15f59 100644 --- a/doc/templates.rst +++ b/doc/templates.rst @@ -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 ` + filter. .. versionadded:: 3.19