In Twig I have operator is and test for empty variable (string or array):
{% if info is empty %}
...
{% endif %}
How I can do something like this in Swig template?
Simply do
{% if !info.length %}
...
{% endif %}
This will match strings (""
), arrays ([]
) and any other object which doesn't have a .length
property with truthy value.