From 7c2479d47b39d46ad1635b8633cca4f609ddea73 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 15 Jan 2013 20:56:11 +0100 Subject: [PATCH] tweaked previous merge --- CHANGELOG | 1 + doc/functions/constant.rst | 6 +++--- lib/Twig/Extension/Core.php | 7 +++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 83656dd..d2767b9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ * 1.12.1 (2013-XX-XX) + * added support for object instances as the second argument of the constant function * relaxed globals management to avoid a BC break * added support for {{ some_string[:2] }} diff --git a/doc/functions/constant.rst b/doc/functions/constant.rst index 0fc190e..bea0e9f 100644 --- a/doc/functions/constant.rst +++ b/doc/functions/constant.rst @@ -1,8 +1,8 @@ ``constant`` ============ -.. versionadded: 1.13 - constant() now accepts object instances as the second argument. +.. versionadded: 1.12.1 + constant now accepts object instances as the second argument. ``constant`` returns the constant value for a given string: @@ -11,7 +11,7 @@ {{ some_date|date(constant('DATE_W3C')) }} {{ constant('Namespace\\Classname::CONSTANT_NAME') }} -As of 1.13 you can read constants from object instances as well: +As of 1.12.1 you can read constants from object instances as well: .. code-block:: jinja diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 077ac5b..2110120 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -1258,11 +1258,10 @@ function twig_include(Twig_Environment $env, $context, $template, $variables = a } /** - * Wrapper around constant() provides the ability to get constants - * from instances as well as class/global constants. + * Provides the ability to get constants from instances as well as class/global constants. * - * @param string $constant The name of the constant. - * @param null|object $object The object to get the constant from. + * @param string $constant The name of the constant + * @param null|object $object The object to get the constant from * * @return string */ -- 1.7.2.5