From: Mark Story Date: Fri, 11 Jan 2013 04:40:58 +0000 (-0500) Subject: Update documentation for constant() X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=c7dafb7e2066ca87482013df37e5cd9d7c89c084;p=web%2Fkonrad%2Ftwig.git Update documentation for constant() --- diff --git a/doc/functions/constant.rst b/doc/functions/constant.rst index 5b247b3..0fc190e 100644 --- a/doc/functions/constant.rst +++ b/doc/functions/constant.rst @@ -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) }}