added the empty test

This commit is contained in:
Fabien Potencier
2010-12-18 11:26:16 +01:00
parent 14341443dd
commit 0d424bff0d
4 changed files with 32 additions and 0 deletions
+12
View File
@@ -1408,6 +1408,18 @@ useful if you use the ``strict_variables`` option:
...
{% endif %}
``empty``
~~~~~~~~~
``empty`` checks if a variable is empty:
.. code-block:: jinja
{# evaluates to true if the foo variable is null, false, or the empty string #}
{% if foo is empty %}
...
{% endif %}
Extensions
----------