From c7dafb7e2066ca87482013df37e5cd9d7c89c084 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 10 Jan 2013 23:40:58 -0500 Subject: [PATCH] Update documentation for constant() --- doc/functions/constant.rst | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) 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) }} -- 1.7.2.5