mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
Use module manager for module initialization
This commit is contained in:
parent
0e99d29b6e
commit
3397adacb2
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user