aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/twig/twig/doc/tests/empty.rst
blob: e5b55999d3b4020adf81eaaf58a69dfb4bd1f63b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
``empty``
=========

``empty`` checks if a variable is empty:

.. code-block:: jinja

    {# evaluates to true if the foo variable is null, false, an empty array, or the empty string #}
    {% if foo is empty %}
        ...
    {% endif %}