How to access class constants in Twig?
{% if var == constant('Namespace\\Entity::TYPE_PERSON') %}{# or #}{% if var is constant('Namespace\\Entity::TYPE_PERSON') %}
See documentation for the constant
function and the constant
test.
{% if var == constant('Namespace\\Entity::TYPE_PERSON') %}{# or #}{% if var is constant('Namespace\\Entity::TYPE_PERSON') %}
See documentation for the constant
function and the constant
test.