From: Fabien Potencier Date: Thu, 16 Dec 2010 08:07:55 +0000 (+0100) Subject: added documentation for the merge filter X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=78b104bfc3d31bbafa98fa44246ce23c2a089cfa;p=web%2Fkonrad%2Ftwig.git added documentation for the merge filter --- diff --git a/doc/templates.rst b/doc/templates.rst index 58e31f9..bad2cb9 100644 --- a/doc/templates.rst +++ b/doc/templates.rst @@ -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) ------------------------------------------