Files
cacti/include/phptwig/doc/functions/constant.rst
T
cigamit 368b5176ad committing Twig 1.24
including for now.  usage later.  its heavy and there is a C extension
that may make it optional too.
2016-03-19 10:34:39 -05:00

19 lines
431 B
ReStructuredText

``constant``
============
.. versionadded: 1.12.1
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.12.1 you can read constants from object instances as well:
.. code-block:: jinja
{{ constant('RSS', date) }}