Added an example for "and" on if statment

This commit is contained in:
Evaldo Junior
2015-04-08 16:01:18 +02:00
committed by Fabien Potencier
parent ca76ad98b9
commit 2698a42284
+8
View File
@@ -37,6 +37,14 @@ You can also use ``not`` to check for values that evaluate to ``false``:
<p>You are not subscribed to our mailing list.</p>
{% endif %}
For multiple conditions ``and`` and ``or`` can be used:
.. code-block:: jinja
{% if temperature > 18 and temperature < 27 %}
<p>It's a nice day for a walk in the park.</p>
{% endif %}
For multiple branches ``elseif`` and ``else`` can be used like in PHP. You can use
more complex ``expressions`` there too: