CodeIgniter实现更改view文件夹路径的方法_PHP教程

WBOY
Release: 2016-07-13 10:26:38
Original
1085 people have browsed it

控制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); }
Copy after login

更改view文件夹语句为:

$this->load->add_package_path ( FCPATH . 'skins/' . base_skins . '/' );
Copy after login

特别注意:

在新建的skins文件夹下需要再新建一个views文件夹,所有的视图文件存放在skins/views文件夹下

www.bkjia.com true http://www.bkjia.com/PHPjc/824616.html TechArticle 控制view文件夹路径的代码:system/core/loader.php public function add_package_path($path, $view_cascade=TRUE){$path = rtrim($path, '/').'/';array_unshift($this-_ci_librar...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!