mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 20:36:33 +00:00
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:
+4
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user