Ver código fonte

[TwigBundle] tweaked a comment

Fabien Potencier 14 anos atrás
pai
commit
e975a09003

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

@@ -30,7 +30,10 @@ class TwigEnvironmentPass implements CompilerPassInterface
 
         $definition = $container->getDefinition('twig');
 
-        // addExtension must be first
+        // Extensions must always be registered before everything else.
+        // For instance, global variable definitions must be registered
+        // afterward. If not, the globals from the extensions will never
+        // be registered.
         $calls = $definition->getMethodCalls();
         $definition->setMethodCalls(array());
         foreach ($container->findTaggedServiceIds('twig.extension') as $id => $attributes) {