Home  >  Article  >  Backend Development  >  How to change the view folder path in CodeIgniter? _PHP Tutorial

How to change the view folder path in CodeIgniter? _PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 10:26:46984browse

Here we share how CodeIgniter implements changing the view folder path

Code that controls the view folder path: 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);
}

Change the view folder statement to:

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

Note:

You need to create a new views folder under the new skins folder. All view files are stored in the skins/views folder.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/822273.htmlTechArticleHere we share the CodeIgniter method of changing the view folder path and controlling the view folder path: system/core/ loader.php public function add_package_path($path, $view_cascade...
Statement:
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