Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 421 Bytes

defined.md

File metadata and controls

27 lines (21 loc) · 421 Bytes
layout title
page
Tests › defined

← tests

defined checks if a variable is defined in the current context.

{# defined works with variable names #}
{% if foo is defined %}
    ...
{% endif %}

{# and attributes on variables names #}
{% if foo.bar is defined %}
    ...
{% endif %}

{% if foo['bar'] is defined %}
    ...
{% endif %}