diff --git a/system/core/Loader.php b/system/core/Loader.php index 21cb32eb930..b9ad33d072d 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -361,7 +361,7 @@ public function controller_output(&$out, $route, $name = NULL, $call = TRUE) // Include source and instantiate object // The Router is responsible for providing a valid path in the route stack - include($path.'controllers/'.$subdir.strtolower($class).'.php'); + include($path.'controllers/'.(!empty($subdir)?$subdir.'/':'').strtolower($class).'.php'); $classnm = ucfirst($class); $this->CI->$name = new $classnm(); @@ -1088,10 +1088,11 @@ protected function _ci_load($_ci_data) foreach ($this->_ci_module_paths as $_ci_mod_path) { // Does the view exist in the module? - if (file_exists($_ci_mod_path.$_ci_viewpath)) + $_ci_subdir = preg_replace('/([^\/]+)/', '$1/views', $_ci_subdir, 1); + if (file_exists($_ci_mod_path.$_ci_subdir.$_ci_file)) { // Set path, mark existing, and quit - $_ci_path = $_ci_mod_path.$_ci_viewpath; + $_ci_path = $_ci_mod_path.$_ci_subdir.$_ci_file; $_ci_exists = TRUE; break; } @@ -1504,4 +1505,4 @@ protected function _ci_object_to_array($object) } /* End of file Loader.php */ -/* Location: ./system/core/Loader.php */ \ No newline at end of file +/* Location: ./system/core/Loader.php */