/**
* 3.1.4 原始代码 - [system/Router.php]
*/
// if ( ! file_exists(APPPATH.‘controllers/‘.$this->directory.ucfirst($class).‘.php‘))
// {
// // This will trigger 404 later
// return;
// }
/**
* 3.1.4 修复代码 - [system/Router.php]
*
* 修复 - 不能将默认控制器放在子目录中
*/
if ( ! file_exists(APPPATH . ‘controllers/‘ . $this->directory . ucfirst($class) . ‘.php‘))
{
$path_arr = explode(‘/‘, trim($this->default_controller, ‘/‘));
$class = ucfirst($path_arr[1]);
$method = isset($path_arr[2]) ? $path_arr[2]: ‘index‘;
if (file_exists(APPPATH . ‘controllers/‘ . $this->directory . $path_arr[0]. ‘/‘ . $class . ‘.php‘))
{
$this->directory .= $path_arr[0]. ‘/‘;
}
}

修改application/config/route.php文件中的默认控制器。

控制器中的方法:


修复后可以使用默认子目录中的控制器。
原文:http://www.cnblogs.com/hfultrastrong/p/6786547.html