From: Fabien Potencier Date: Wed, 1 May 2013 08:03:10 +0000 (+0200) Subject: added a precedence example (refs #1057) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=2acd63ae31f035084e57f0fbbd06b180507205ab;p=web%2Fkonrad%2Ftwig.git added a precedence example (refs #1057) --- diff --git a/doc/templates.rst b/doc/templates.rst index b6857a5..a329c92 100644 --- a/doc/templates.rst +++ b/doc/templates.rst @@ -558,7 +558,17 @@ even if you're not working with PHP you should feel comfortable with it. operators listed first: ``b-and``, ``b-xor``, ``b-or``, ``or``, ``and``, ``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``, ``in``, ``..``, ``+``, ``-``, ``~``, ``*``, ``/``, ``//``, ``%``, ``is``, ``**``, ``|``, ``[]``, - and ``.``. + and ``.``: + + .. code-block:: jinja + + {% set greeting = 'Hello' %} + {% set name = 'Fabien' %} + + {{ greeting ~ name|lower }} {# Hello fabien #} + + {# use parenthesis to change precedence #} + {{ (greeting ~ name)|lower }} {# hello fabien #} Literals ~~~~~~~~