How does CodeIgniter change the view folder path? _ PHP Tutorial

Source: Internet
Author: User
How does CodeIgniter change the view folder path ?. Here is the code used to control the view folder path by changing the view folder path using CodeIgniter: systemcoreloader. phppublicfunctionadd_package_path ($ path, $ view_cascade. here is the CodeIgniter method to change the view folder path.

Code for controlling 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; // add the configuration file $ config = & $ this-> _ ci_get_component ('config '); array_unshift ($ config-> _ config_paths, $ path );}

Statement for changing the view folder:

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

Note:

Create a new view folder under the newly created skins folder. all view files are stored in the skins/views folder.

The code used to control the path of the view folder: system/core/loader. php public function add_package_path ($ path, $ view_cascade...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.