Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

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 %}