Skip to content

Commit

Permalink
Adding example with not for if
Browse files Browse the repository at this point in the history
I could not find an example with ``not``, so I added it here.
  • Loading branch information
InFog committed Dec 16, 2014
1 parent a1b847b commit 4a75e40
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/tags/if.rst
Expand Up @@ -29,6 +29,14 @@ You can also test if an array is not empty:
If you want to test if the variable is defined, use ``if users is
defined`` instead.

You can also use ``not`` to check for values that evaluate to ``false``:

.. code-block:: jinja
{% if not user.subscribed %}
<p>You are not subscribed to our mailing list.</p>
{% endif %}
For multiple branches ``elseif`` and ``else`` can be used like in PHP. You can use
more complex ``expressions`` there too:

Expand Down

0 comments on commit 4a75e40

Please sign in to comment.