From e782d41963b6674eaaf9d7f10b07fabe0fa0dbc9 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 18 Dec 2010 13:44:51 +0100 Subject: [PATCH] fixed if tag documentation --- doc/templates.rst | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/templates.rst b/doc/templates.rst index 30d6b24..33e0844 100644 --- a/doc/templates.rst +++ b/doc/templates.rst @@ -604,9 +604,8 @@ course this is not limited to commas: If ~~ -The ``if`` statement in Twig is comparable with the if statements of PHP. In the -simplest form you can use it to test if a variable is defined, not empty or -not false: +The ``if`` statement in Twig is comparable with the if statements of PHP. In +the simplest form you can use it to test if a variable is not empty: .. code-block:: jinja @@ -618,6 +617,11 @@ not false: {% endif %} +.. note:: + + If you want to test if the variable is defined, use ``if users is + defined`` instead. + For multiple branches ``elseif`` and ``else`` can be used like in PHP. You can use more complex ``expressions`` there too: -- 1.7.2.5