Checks if a variable is empty.
<pre> {# evaluates to true if the foo variable is null, false, or the empty string #} {% if foo is empty %} {# ... #} {% endif %} </pre>
mixed $value A variable:
Boolean true if the value is empty, false otherwise
function twig_test_empty($value) {
if ($value instanceof Countable) {
return 0 == count($value);
}
return false === $value || empty($value) && '0' != $value;
}