From 2acd63ae31f035084e57f0fbbd06b180507205ab Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 1 May 2013 10:03:10 +0200 Subject: [PATCH] added a precedence example (refs #1057) --- doc/templates.rst | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) 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 ~~~~~~~~ -- 1.7.2.5