Commit 29242300 authored by Fabien Potencier's avatar Fabien Potencier

moved Twig configure method as late as possible (all other extensions must be registered before)

parent 3c6b834d
......@@ -24,9 +24,6 @@ class TwigExtension implements ExtensionInterface
$app['twig'] = $app->share(function () use ($app) {
$twig = new \Twig_Environment($app['twig.loader'], isset($app['twig.options']) ? $app['twig.options'] : array());
$twig->addGlobal('app', $app);
if (isset($app['twig.configure'])) {
$app['twig.configure']($twig);
}
if (isset($app['symfony_bridges'])) {
if (isset($app['url_generator'])) {
......@@ -38,6 +35,10 @@ class TwigExtension implements ExtensionInterface
}
}
if (isset($app['twig.configure'])) {
$app['twig.configure']($twig);
}
return $twig;
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment