Last active
December 25, 2015 12:19
-
-
Save madebydavid/6976097 to your computer and use it in GitHub Desktop.
Silex Web Profile Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"silex/silex": "~1.1", | |
"silex/web-profiler": "~1.0", | |
"twig/twig": ">=1.8,<2.0-dev" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__.'/vendor/autoload.php'; | |
$app = new Silex\Application(); | |
$app['debug'] = true; | |
$app->register(new Silex\Provider\TwigServiceProvider(), array( | |
'twig.path' => __DIR__ | |
)); | |
/* Offending line? */ | |
$app['twig']->addGlobal('foo', 'bar'); | |
$app->register(new Silex\Provider\ServiceControllerServiceProvider()); | |
$app->register(new Silex\Provider\UrlGeneratorServiceProvider()); | |
$app->register($p = new Silex\Provider\WebProfilerServiceProvider(), array( | |
'profiler.cache_dir' => __DIR__.'/cache/profiler', | |
'profiler.mount_prefix' => '/_profiler', | |
)); | |
$app->match('/', function () use ($app) { | |
return $app['twig']->render('index.twig'); | |
}); | |
$app->run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h1>TEST</h1> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment