added documentation for the merge filter

This commit is contained in:
Fabien Potencier
2010-12-16 09:07:55 +01:00
parent b792382126
commit 78b104bfc3
+11
View File
@@ -1314,6 +1314,17 @@ the last filter applied to it.
{{ some_date|date('DATE_W3C'|constant) }}
``merge`` (new in Twig 0.9.10)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``merge`` filter merges an array or a hash with the value:
.. code-block:: jinja
{% set items = { 'apple': 'fruit', 'orange': 'fruit' } %}
{% set items = items|merge({ 'peugeot': 'car' }) %}
List of built-in Tests (new in Twig 0.9.9)
------------------------------------------