소스 검색

[TwigBundle] addExtension calls must be first

partugal 14 년 전
부모
커밋
5ac67a23e7
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php

+ 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));
     }
 }