minor #2134 Expanded definition of empty (servel333)

This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes #2134).

Discussion
----------

Expanded definition of empty

Based on the [source](https://github.com/twigphp/Twig/blob/f61bc838a97c26e2952af09070d1c4847eeedbe7/lib/Twig/Extension/Core.php#L1405), defined 'empty'. The comment in the code block is too subtle and I didn't notice it until I got to the edit page, and it also does not fully describe the definition of empty based on what the code does.

Commits
-------

9c6b8cb Expanded definition of empty
This commit is contained in:
Fabien Potencier
2016-09-21 13:27:28 -07:00
+4 -1
View File
@@ -1,7 +1,7 @@
``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
@@ -9,3 +9,6 @@
{% if foo is empty %}
...
{% endif %}
.. _Countable: http://php.net/manual/en/class.countable.php
.. _count: http://php.net/manual/en/function.count.php