This article mainly introduces the automatic loading of classes in the CI framework, and analyzes the automatic loading function and specific operation skills of classes in the CI framework based on the instance form, for more information about the automatic loading of classes in the CI framework, see the example in this article. We will share this with you for your reference. The details are as follows:
Application/config
Add the following in the configuration file:
| 1. Packages
| 2. Libraries
| 3. Helper files
| 4. Custom config files
| 5. Language files
| 6. Models
1. third-party library file loading
// $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');$autoload['packages'] = array();
2. system library loading
// $autoload['libraries'] = array('database', 'session', 'xmlrpc');$autoload['libraries'] = array('database','session','form_validation','pagination','upload','curl','user_agent');
3. Help File loading
// $autoload['helper'] = array('url', 'file');$autoload['helper'] = array('url','cookie','form','captcha','string','html','array','date','file','common');
4. configure File loading
// $autoload['config'] = array('config1', 'config2');$autoload['config'] = array();
5. language file loading
// $autoload['language'] = array('lang1', 'lang2');$autoload['language'] = array();
6. Automatic loading of data models
//$autoload['model'] = array('model1', 'model2');$autoload['model'] = array('');