mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 19:36:43 +00:00
Added an example for "and" on if statment
This commit is contained in:
committed by
Fabien Potencier
parent
ca76ad98b9
commit
2698a42284
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user