How to solve the problem of automatic loading of classes in CI Framework
How to solve the automatic loading problem of classes in CI framework, for this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more small partners who want to solve this problem find a simpler and easier way.
application/config
Add to profile:
| 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 class 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. profile load
// $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 ('model 1','model 2');$autoload <$'model'] = array (''); The answer to the problem of automatic loading of classes in CI framework is shared here. I hope the above content can be helpful to everyone. If you still have a lot of doubts, you can pay attention to the industry information channel for more relevant knowledge.