Update documentation for constant()

This commit is contained in:
Mark Story
2013-01-10 23:40:58 -05:00
parent cb921ce602
commit c7dafb7e20
+9
View File
@@ -1,9 +1,18 @@
``constant``
============
.. versionadded: 1.13
constant() now accepts object instances as the second argument.
``constant`` returns the constant value for a given string:
.. code-block:: jinja
{{ some_date|date(constant('DATE_W3C')) }}
{{ constant('Namespace\\Classname::CONSTANT_NAME') }}
As of 1.13 you can read constants from object instances as well:
.. code-block:: jinja
{{ constant('RSS', date) }}