ソースを参照

[TwigBundle] addExtension calls must be first

partugal 14 年 前
コミット
5ac67a23e7

+ 4 - 0
src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php

@@ -30,8 +30,12 @@ class TwigEnvironmentPass implements CompilerPassInterface
 
         $definition = $container->getDefinition('twig');
 
+        // addExtension must be first
+        $calls = $definition->getMethodCalls();
+        $definition->setMethodCalls(array());
         foreach ($container->findTaggedServiceIds('twig.extension') as $id => $attributes) {
             $definition->addMethodCall('addExtension', array(new Reference($id)));
         }
+        $definition->setMethodCalls(array_merge($definition->getMethodCalls(), $calls));
     }
 }