pico/lib/twig/doc/tests/constant.rst
Gilbert Pellegrom 92b792e8f2 Initial commit.
2012-04-04 14:45:09 +01:00

12 lines
321 B
ReStructuredText
Executable File

``constant``
============
``constant`` checks if a variable has the exact same value as a constant. You
can use either global constants or class constants:
.. code-block:: jinja
{% if post.status is constant('Post::PUBLISHED') %}
the status attribute is exactly the same as Post::PUBLISHED
{% endif %}