Use module manager for module initialization

This commit is contained in:
Dennis Eichhorn 2017-01-29 19:10:48 +01:00
parent 0e99d29b6e
commit 3397adacb2

View File

@ -184,7 +184,12 @@ class Dispatcher
throw new PathException($path);
}
$this->controllers[$controller] = new $controller($this->app);
// If module controller use module manager for initialization
if(count($split = explode('\\', $controller)) === 4) {
$this->controllers[$controller] = $this->app->moduleManager->get($split[2]);
} else {
$this->controllers[$controller] = new $controller($this->app);
}
}
return $this->controllers[$controller];