mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 11:56:50 +00:00
Tweak twig_constant()
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user