From 3fb1f2302e9d8b7319f79ea80eed545f4ad3ac74 Mon Sep 17 00:00:00 2001 From: Pascal Luna Date: Thu, 25 May 2017 03:39:00 +0100 Subject: [PATCH] Added twig-bundle support --- WebProfilerServiceProvider.php | 7 +++++++ composer.json | 1 + 2 files changed, 8 insertions(+) diff --git a/WebProfilerServiceProvider.php b/WebProfilerServiceProvider.php index 49073679..b9c0d61c 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" },