From: Fabien Potencier Date: Fri, 13 Jan 2012 09:18:17 +0000 (+0100) Subject: tweaked documentation X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=087df0513e590c582d1ca8ad321e98540654f9a7;p=web%2Fkonrad%2Ftwig.git tweaked documentation --- 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