4 .. versionadded: 1.13.1
5 constant now accepts object instances as the second argument.
7 ``constant`` checks if a variable has the exact same value as a constant. You
8 can use either global constants or class constants:
12 {% if post.status is constant('Post::PUBLISHED') %}
13 the status attribute is exactly the same as Post::PUBLISHED
16 You can test constants from object instances as well:
20 {% if post.status is constant('PUBLISHED', post) %}
21 the status attribute is exactly the same as Post::PUBLISHED