From 087df0513e590c582d1ca8ad321e98540654f9a7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 13 Jan 2012 10:18:17 +0100 Subject: [PATCH] tweaked documentation --- doc/tags/if.rst | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/tags/if.rst b/doc/tags/if.rst index 9540fa5..14e12b1 100644 --- a/doc/tags/if.rst +++ b/doc/tags/if.rst @@ -1,8 +1,18 @@ ``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 not empty: +The ``if`` statement in Twig is comparable with the if statements of PHP. + +In the simplest form you can use it to test if an expression evaluates to +``true``: + +.. code-block:: jinja + + {% if online == false %} +

Our website is in maintenance mode. Please, come back later.

+ {% endif %} + +You can also test if an array is not empty: .. code-block:: jinja -- 1.7.2.5