From 78b104bfc3d31bbafa98fa44246ce23c2a089cfa Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 16 Dec 2010 09:07:55 +0100 Subject: [PATCH] added documentation for the merge filter --- doc/templates.rst | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) 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) ------------------------------------------ -- 1.7.2.5