mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-19 05:46:41 +00:00
[doc] "map" filter: fix args order (value, key)
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ The arrow function also receives the key as a second argument:
|
|||||||
"Alice": "Dupond",
|
"Alice": "Dupond",
|
||||||
} %}
|
} %}
|
||||||
|
|
||||||
{{ people|map((first, last) => "#{first} #{last}")|join(', ') }}
|
{{ people|map((last, first) => "#{first} #{last}")|join(', ') }}
|
||||||
{# outputs Bob Smith, Alice Dupond #}
|
{# outputs Bob Smith, Alice Dupond #}
|
||||||
|
|
||||||
Note that the arrow function has access to the current context.
|
Note that the arrow function has access to the current context.
|
||||||
|
|||||||
Reference in New Issue
Block a user