Determines what should be served based on the URI request,
as well as any "routes" that have been set in the routing config file.
protected _set_routing ( ) : void | ||
Résultat | void |
function _set_routing() { parent::_set_routing(); // re-routed url if ($this->uri->rsegments != $this->segments) { if (count($this->uri->rsegments) > 0) { array_unshift($this->uri->rsegments, $this->_route['directory']); } } }
/** * _set_routing * * Adds routes that are stored in the /application/routes/ directory * then calls the usual _set_routing method * * @return void */ protected function _set_routing() { // Load the routes.php file. if (is_dir(APPPATH . 'routes')) { $file_list = scandir(APPPATH . 'routes'); foreach ($file_list as $file) { if (is_file(APPPATH . 'routes/' . $file) and pathinfo($file, PATHINFO_EXTENSION) == 'php') { include APPPATH . 'routes/' . $file; } } } parent::_set_routing(); }