diff --git a/WebProfilerServiceProvider.php b/WebProfilerServiceProvider.php index a642261a..1c23910e 100644 --- a/WebProfilerServiceProvider.php +++ b/WebProfilerServiceProvider.php @@ -309,6 +309,7 @@ public function register(Container $app) $app->extend('twig.loader.filesystem', function ($loader, $app) { $loader->addPath($app['profiler.templates_path'], 'WebProfiler'); + $loader->addPath($app['profiler.templates_path.twig'], 'Twig'); if ($app['profiler.templates_path.debug']) { $loader->addPath($app['profiler.templates_path.debug'], 'Debug'); } @@ -322,6 +323,12 @@ public function register(Container $app) return dirname(dirname($r->getFileName())).'/Resources/views'; }; + $app['profiler.templates_path.twig'] = function () { + $r = new \ReflectionClass('Symfony\Bundle\TwigBundle\Controller\ExceptionController'); + + return dirname(dirname($r->getFileName())).'/Resources/views'; + }; + $app['profiler.templates_path.debug'] = function () { // This code cannot be simplified as all classes in the bundle depend // on packages that are not required by Silex diff --git a/composer.json b/composer.json index 05d385e0..b5ca9ee1 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,7 @@ "require": { "silex/silex": "^2.0", "symfony/web-profiler-bundle": "^2.8|^3.0", + "symfony/twig-bundle": "^2.8|^3.0", "symfony/twig-bridge": "^2.8|^3.0", "symfony/stopwatch": "^2.8|^3.0" },