fixed array support in twig globals
This commit is contained in:
parent
98c1056fbf
commit
26666a272d
@ -78,7 +78,7 @@ class TwigExtension extends Extension
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
foreach ($globals as $key => $value) {
|
foreach ($globals as $key => $value) {
|
||||||
if ('@' === substr($value, 0, 1)) {
|
if (is_string($value) && '@' === substr($value, 0, 1)) {
|
||||||
$def->addMethodCall('addGlobal', array($key, new Reference(substr($value, 1))));
|
$def->addMethodCall('addGlobal', array($key, new Reference(substr($value, 1))));
|
||||||
} else {
|
} else {
|
||||||
$def->addMethodCall('addGlobal', array($key, $value));
|
$def->addMethodCall('addGlobal', array($key, $value));
|
||||||
|
Reference in New Issue
Block a user