mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 19:06:40 +00:00
Expanded definition of empty
This commit is contained in:
committed by
Fabien Potencier
parent
f2a9ef3579
commit
9c6b8cb3e4
+4
-1
@@ -1,7 +1,7 @@
|
|||||||
``empty``
|
``empty``
|
||||||
=========
|
=========
|
||||||
|
|
||||||
``empty`` checks if a variable is empty:
|
``empty`` checks if a variable is an empty string, an empty array, an empty hash, exactly ``false``, exactly ``null``:
|
||||||
|
|
||||||
.. code-block:: jinja
|
.. code-block:: jinja
|
||||||
|
|
||||||
@@ -9,3 +9,6 @@
|
|||||||
{% if foo is empty %}
|
{% if foo is empty %}
|
||||||
...
|
...
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
.. _Countable: http://php.net/manual/en/class.countable.php
|
||||||
|
.. _count: http://php.net/manual/en/function.count.php
|
||||||
|
|||||||
Reference in New Issue
Block a user