Files
Twig/doc/filters/merge.rst
T
2011-09-27 08:43:35 +02:00

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' } #}