Преглед на файлове

[TwigBundle] tweaked a comment

Fabien Potencier преди 14 години
родител
ревизия
e975a09003
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php

+ 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) {