Update to CodeIgniter 2.1.0
This commit is contained in:
@@ -28,12 +28,54 @@
|
||||
*/
|
||||
class CI_Router {
|
||||
|
||||
/**
|
||||
* Config class
|
||||
*
|
||||
* @var object
|
||||
* @access public
|
||||
*/
|
||||
var $config;
|
||||
/**
|
||||
* List of routes
|
||||
*
|
||||
* @var array
|
||||
* @access public
|
||||
*/
|
||||
var $routes = array();
|
||||
/**
|
||||
* List of error routes
|
||||
*
|
||||
* @var array
|
||||
* @access public
|
||||
*/
|
||||
var $error_routes = array();
|
||||
/**
|
||||
* Current class name
|
||||
*
|
||||
* @var string
|
||||
* @access public
|
||||
*/
|
||||
var $class = '';
|
||||
/**
|
||||
* Current method name
|
||||
*
|
||||
* @var string
|
||||
* @access public
|
||||
*/
|
||||
var $method = 'index';
|
||||
/**
|
||||
* Sub-directory that contains the requested controller class
|
||||
*
|
||||
* @var string
|
||||
* @access public
|
||||
*/
|
||||
var $directory = '';
|
||||
/**
|
||||
* Default controller (and method if specific)
|
||||
*
|
||||
* @var string
|
||||
* @access public
|
||||
*/
|
||||
var $default_controller;
|
||||
|
||||
/**
|
||||
@@ -95,7 +137,7 @@ class CI_Router {
|
||||
{
|
||||
include(APPPATH.'config/routes.php');
|
||||
}
|
||||
|
||||
|
||||
$this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route;
|
||||
unset($route);
|
||||
|
||||
@@ -244,7 +286,20 @@ class CI_Router {
|
||||
// Does the requested controller exist in the sub-folder?
|
||||
if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].'.php'))
|
||||
{
|
||||
show_404($this->fetch_directory().$segments[0]);
|
||||
if ( ! empty($this->routes['404_override']))
|
||||
{
|
||||
$x = explode('/', $this->routes['404_override']);
|
||||
|
||||
$this->set_directory('');
|
||||
$this->set_class($x[0]);
|
||||
$this->set_method(isset($x[1]) ? $x[1] : 'index');
|
||||
|
||||
return $x;
|
||||
}
|
||||
else
|
||||
{
|
||||
show_404($this->fetch_directory().$segments[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user