Skip to content
This repository was archived by the owner on Sep 14, 2018. It is now read-only.

Commit 57488d3

Browse files
committed
bug #120 Add twig-bundle support (skalpa)
This PR was merged into the 2.0.x-dev branch. Discussion ---------- Add twig-bundle support Adds `symfony/twig-bundle` to the list of dependencies and registers the `@Twig` templates namespace. - This fixes #109 and closes #110 - It also _fixes_ the exception page (eg: on `3.3` we get the fancy new page 😄 ) Commits ------- 3fb1f23 Added twig-bundle support
2 parents 0b56bca + 3fb1f23 commit 57488d3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

WebProfilerServiceProvider.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ public function register(Container $app)
309309

310310
$app->extend('twig.loader.filesystem', function ($loader, $app) {
311311
$loader->addPath($app['profiler.templates_path'], 'WebProfiler');
312+
$loader->addPath($app['profiler.templates_path.twig'], 'Twig');
312313
if ($app['profiler.templates_path.debug']) {
313314
$loader->addPath($app['profiler.templates_path.debug'], 'Debug');
314315
}
@@ -322,6 +323,12 @@ public function register(Container $app)
322323
return dirname(dirname($r->getFileName())).'/Resources/views';
323324
};
324325

326+
$app['profiler.templates_path.twig'] = function () {
327+
$r = new \ReflectionClass('Symfony\Bundle\TwigBundle\Controller\ExceptionController');
328+
329+
return dirname(dirname($r->getFileName())).'/Resources/views';
330+
};
331+
325332
$app['profiler.templates_path.debug'] = function () {
326333
// This code cannot be simplified as all classes in the bundle depend
327334
// on packages that are not required by Silex

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"require": {
1313
"silex/silex": "^2.0",
1414
"symfony/web-profiler-bundle": "^2.8|^3.0",
15+
"symfony/twig-bundle": "^2.8|^3.0",
1516
"symfony/twig-bridge": "^2.8|^3.0",
1617
"symfony/stopwatch": "^2.8|^3.0"
1718
},

0 commit comments

Comments
 (0)