MVC, use predefined configuration in stead of relative path in service conf to ease development/test setup.

This commit is contained in:
Ad Schellevis 2018-03-04 15:18:17 +01:00
parent dfe4fe64c9
commit ad089da837
2 changed files with 4 additions and 6 deletions

View File

@ -107,9 +107,8 @@ $di->set('config', $config);
/**
* Setup router
*/
$di->set('router', function () {
$routing = new Routing(__DIR__."/../controllers/", "ui");
$di->set('router', function () use ($config) {
$routing = new Routing($config->application->controllersDir, "ui");
$routing->getRouter()->handle();
return $routing->getRouter();
});

View File

@ -85,9 +85,8 @@ $di->set('config', $config);
/**
* Setup router
*/
$di->set('router', function () {
$routing = new Routing(__DIR__."/../controllers/", "api");
$di->set('router', function () use ($config) {
$routing = new Routing($config->application->controllersDir, "api");
$routing->getRouter()->handle();
return $routing->getRouter();
});