当前位置: 编程技术>php
CodeIgniter怎么更改view文件夹路径?
来源: 互联网 发布时间:2014-08-30
本文导语: CodeIgniter怎么更改view文件夹路径? 在CodeIgniter框架中,控制view文件夹路径的代码:system/core/loader.php 代码示例: public function add_package_path($path, $view_cascade=TRUE) { $path = rtrim($path, '/').'/'; array_unshift($this->_ci_library_paths, $path); arr...
CodeIgniter怎么更改view文件夹路径?
在CodeIgniter框架中,控制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);
}
{
$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文件夹下。