控制view文件夾路徑的代碼:system/core/loader.php
public function add_package_path($path, $view_cascade=TRUE) { $path = rtrim($path, '/').'/'; array_unshift($this->_ci_library_paths, $path); array_unshift($this->_ci_model_paths, $path); array_unshift($this->_ci_helper_paths, $path); $this->_ci_view_paths = array($path.'views/' => $view_cascade) + $this->_ci_view_paths; // 添加配置文件 $config =& $this->_ci_get_component('config'); array_unshift($config->_config_paths, $path); }
更改view文件夾語句為:
$this->load->add_package_path ( FCPATH . 'skins/' . base_skins . '/' );
注意:
在新建的skins文件夾下需要再新建一個views文件夾,所有的視圖文件存放在skins/views文件夾下.