projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
b792382
)
added documentation for the merge filter
author
Fabien Potencier
<fabien.potencier@gmail.com>
Thu, 16 Dec 2010 08:07:55 +0000 (09:07 +0100)
committer
Fabien Potencier
<fabien.potencier@gmail.com>
Thu, 16 Dec 2010 08:07:55 +0000 (09:07 +0100)
doc/templates.rst
patch
|
blob
|
history
diff --git
a/doc/templates.rst
b/doc/templates.rst
index
58e31f9
..
bad2cb9
100644
(file)
--- 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)
------------------------------------------