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