public function _set_default_controller() { if (empty($this->directory)) { /* set the default controller module path */ $this->_set_module_path($this->default_controller); } parent::_set_default_controller(); if (empty($this->class)) { $this->_set_404override_controller(); } }
/** * Set default controller * * @return void */ protected function _set_default_controller() { parent::_set_default_controller(); $this->active_route = 'default_controller'; }
/** * Set default controller * * First we check in normal APPPATH/controller's location, * then in Modules named after the default_controller * @author hArpanet - based on system/core/Router.php * * @return void */ protected function _set_default_controller() { // controller in APPPATH/controllers takes priority over module with same name parent::_set_default_controller(); // see if parent found a controller $class = $this->fetch_class(); if (empty($class)) { // no 'normal' controller found, // get the class/method from the default_controller route if (sscanf($this->default_controller, '%[^/]/%s', $class, $method) !== 2) { $method = 'index'; } // try to locate default controller in modules if ($located = $this->locate(array($class, $class, $method))) { log_message('debug', 'No URI present. Default module controller set.'); } } // Nothing found - this will trigger 404 later }
protected function _set_default_controller() { if ($bundle_path = $this->bundle->get_active_path()) { if (file_exists($bundle_path . 'config/routes.php')) { include $bundle_path . 'config/routes.php'; } isset($route['default_controller']) && ($this->default_controller = $route['default_controller']); unset($route['default_controller'], $route['translate_uri_dashes']); } return parent::_set_default_controller(); }