Commit d1f29680 authored by Adrien's avatar Adrien

[change] Namespaces for Twig paths

parent c62cfba1
...@@ -154,7 +154,17 @@ class TwigServiceProvider implements ServiceProviderInterface ...@@ -154,7 +154,17 @@ class TwigServiceProvider implements ServiceProviderInterface
}; };
$app['twig.loader.filesystem'] = function ($app) { $app['twig.loader.filesystem'] = function ($app) {
return new \Twig_Loader_Filesystem($app['twig.path']); $paths = is_array($app['twig.path']) ? $app['twig.path'] : array($app['twig.path']);
$fileSystem = new \Twig_Loader_Filesystem();
foreach ($paths as $key => $val) {
if (is_string($key)) {
$fileSystem->addPath($key, $val);
} else {
$fileSystem->addPath($val);
}
}
return $fileSystem;
}; };
$app['twig.loader.array'] = function ($app) { $app['twig.loader.array'] = function ($app) {
......
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