1
0
mirror of https://gitnet.fr/deblan/gist.git synced 2021-08-14 08:30:49 +02:00
GIST/app/bootstrap.php.d/20-routing.php
Simon Vieille 51d736cb1a Controller: refactoring ($app access)
"GistService" renamed as "Gist"
Authentication
2015-11-23 13:19:13 +01:00

27 lines
674 B
PHP

<?php
use Symfony\Component\Routing\Loader\YamlFileLoader;
use Gist\ControllerResolver;
$app['routing.file'] = 'routing.yml';
$app['routing.loader'] = $app->share(function ($app) {
return new YamlFileLoader($app['config.locator']);
});
$app['routes'] = $app->extend('routes', function ($routes, $app) {
$routes->addCollection($app['routing.loader']->load($app['routing.file']));
return $routes;
});
$app['resolver'] = $app->share(function () use ($app) {
if (isset($app['logger'])){
$logger = $app['logger'];
} else{
$logger = null;
}
return new ControllerResolver($app, isset($app['logger']) ? $app['logger'] : null);
});