瀏覽代碼

fixed array support in twig globals

Lukas Kahwe Smith 14 年之前
父節點
當前提交
26666a272d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

+ 1 - 1
src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

@@ -78,7 +78,7 @@ class TwigExtension extends Extension
             }
         } else {
             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))));
                 } else {
                     $def->addMethodCall('addGlobal', array($key, $value));