$this->load->library () Usage analysis in CI framework, this-load-
This paper analyzes the use of $this->load->library () in CI framework. Share to everyone for your reference, as follows:
The first time I failed to load, the original file name and the class name are different reasons, first summarize about CI loading your own class file considerations:
1. Third-party loading should be placed under the Application/libraries file
2. The file name and class name should be the same, and the first letter capitalized, such as the file name excel.php class name should be Excel
3. By:$this->load->library (' class '); The way to load it where you need it
4. Can also be loaded in the application/config/autoload.php, add in the file
$autoload [' libraries '] = Array (' Excel ');
5. When loading, if libraries has multiple folders, such as myfile can be loaded in the following way:
$this->load->library (' myfile/class ');
6. The second parameter can be placed as a parameter, as follows:
$config = Array (' mailtype ' = ' html ', ' charset ' = ' utf-8 ', ' priority ' = ' 1 ');
$this->load->library (' email ', $config);
7. The third parameter can use your custom name in the following way:
$this->load->library (' Session ', ' ', ' my_session ');//The session class can now be accessed in the following way: $this->my_session->set_ UserData ("Session name", "Session value");
More interested in CodeIgniter related content readers can view this site topic: "CodeIgniter Introductory Tutorial", "CI (codeigniter) Framework Advanced Tutorial", "PHP Excellent Development Framework Summary", "thinkphp Getting Started", " Summary of common methods of thinkphp, "Introduction to Zend Framework Frame", "Introduction to PHP Object-oriented Programming", "Introduction to Php+mysql Database Operation" and "PHP common database Operation Skills Summary"
It is hoped that this article is helpful to the PHP program design based on CodeIgniter framework.
http://www.bkjia.com/PHPjc/1127850.html www.bkjia.com true http://www.bkjia.com/PHPjc/1127850.html techarticle $this-load-library () usage analysis in CI framework, this-load-This paper analyzes the usage of $this-load-library () in CI framework. Share to everyone for your reference, as follows: I first load ...