projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
2a7d317
)
Tweak twig_constant()
author
Eugene Leonovich
<gen.work@gmail.com>
Wed, 16 Jan 2013 08:40:49 +0000 (09:40 +0100)
committer
Eugene Leonovich
<gen.work@gmail.com>
Wed, 16 Jan 2013 08:40:49 +0000 (09:40 +0100)
lib/Twig/Extension/Core.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Extension/Core.php
b/lib/Twig/Extension/Core.php
index
2110120
..
c1a37d8
100644
(file)
--- a/
lib/Twig/Extension/Core.php
+++ b/
lib/Twig/Extension/Core.php
@@
-1267,10
+1267,9
@@
function twig_include(Twig_Environment $env, $context, $template, $variables = a
*/
function twig_constant($constant, $object = null)
{
- if (!$object) {
- return constant($constant);
+ if ($object) {
+ $constant = get_class($object).'::'.$constant;
}
- $class = get_class($object);
- return constant($class.'::'.$constant);
+ return constant($constant);
}