You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quite a few applications use constants to make various magic numbers
and strings more memorable, and usable. Would it be useful to have a
test in twig allowing you to check values against global and class
constants. Proposed implementation would be:
{% if my_value is constant('ADMIN_LVL') %}
or
{% if post.state is constant('Post::PUBLISHED') %}
The text was updated successfully, but these errors were encountered:
I guess it could be done as a filter as well. I originally thought of a test because I normally use constants in if statements. I usually think of filters as output manipulation, and I don't normally output constants. But the date() case is interesting.
Quite a few applications use constants to make various magic numbers
and strings more memorable, and usable. Would it be useful to have a
test in twig allowing you to check values against global and class
constants. Proposed implementation would be:
{% if my_value is constant('ADMIN_LVL') %}
or
{% if post.state is constant('Post::PUBLISHED') %}
The text was updated successfully, but these errors were encountered: