is_defined

Tests if a value is defined.

Checks if the value is not empty and outputs a boolean true or false. This is useful in combination with the if tag.

For example:

{% if value|is_defined %}The value was defined{% endif %}

When the value is “foo” then the output “The value was defined”.

Edit on GitHub

if_undefined Variables is_undefined

Referred by

Filters

Filters transform template variables before they are rendered.