mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-21 07:37:43 +00:00
added the empty test
This commit is contained in:
@@ -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
|
||||
----------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user