From 3397adacb2626a798a8d94c0669542c012e4a78d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 29 Jan 2017 19:10:48 +0100 Subject: [PATCH] Use module manager for module initialization --- Dispatcher/Dispatcher.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dispatcher/Dispatcher.php b/Dispatcher/Dispatcher.php index 251d2e56e..d83e7a450 100644 --- a/Dispatcher/Dispatcher.php +++ b/Dispatcher/Dispatcher.php @@ -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];