/** * Initialize Controller paths * * @return void */ public function initControllers() { /** * Controller directory will be: * * 'aliasName' => 'moduleName' * 'moduleName' => 'moduleName' * * Alias-name will have higher priority than module-name */ $arrayModule = Vi_Initializer::$_config['module']; $arrayModule = array_merge(Vi_Initializer::$_config['requiredModule'], $arrayModule); $moduleAlisases = $arrayModule; foreach ($arrayModule as $key => $item) { $arrayModule[$key] = 'modules/' . $item . '/controllers/'; if (array_key_exists($item, $arrayModule)) { continue; } $arrayModule[$item] = 'modules/' . $item . '/controllers/'; $moduleAlisases[$item] = $item; } // echo Vi_Registry::get('APP_BASE_URL');die; Vi_Registry::set('moduleAliases', $moduleAlisases); $this->_front->setDefaultModule(Vi_Initializer::$_config['defaultModule']); $this->_front->setDefaultControllerName(Vi_Initializer::$_config['defaultController']); $this->_front->setDefaultAction(Vi_Initializer::$_config['defaultAction']); $this->_front->setControllerDirectory($arrayModule); $this->_front->setBaseUrl(Vi_Registry::get('APP_BASE_URL')); $this->_front->setParam('prefixDefaultModule', true); }