mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-21 07:37:43 +00:00
13 lines
321 B
ReStructuredText
13 lines
321 B
ReStructuredText
``merge``
|
|
=========
|
|
|
|
The ``merge`` filter merges an array or a hash with the given value:
|
|
|
|
.. code-block:: jinja
|
|
|
|
{% set items = { 'apple': 'fruit', 'orange': 'fruit' } %}
|
|
|
|
{% set items = items|merge({ 'peugeot': 'car' }) %}
|
|
|
|
{# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car' } #}
|