Skip to content

Latest commit

 

History

History
24 lines (21 loc) · 463 Bytes

twig.md

File metadata and controls

24 lines (21 loc) · 463 Bytes

Twig

You can check the feature flag state with the following twig methods.

Simple check:

{% if feature('feature_123') %}
    {# ... #}
{% endif %}

Same check with other syntax:

{% if 'feature_123' is active feature %}
    {# ... #}
{% endif %}

Check with context data (see constraint documentation)

{% if feature('feature_123', {'role': 'ROLE_ADMIN'}) %}
    {# ... #}
{% endif %}