本文实例讲述了ci框架中类的自动加载问题。分享给大家供大家参考,具体如下:
application/config
配置文件中添加:
| 1. Packages
| 2. Libraries
| 3. Helper files
| 4. Custom config files
| 5. Language files
| 6. Models
1. 第三方库文件加载
// $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared'); $autoload['packages'] = array();
2. 系统类库加载
立即学习“PHP免费学习笔记(深入)”;
// $autoload['libraries'] = array('database', 'session', 'xmlrpc');
$autoload['libraries'] = array('database','session','form_validation','pagination','upload','curl','user_agent');
3. 帮助文件加载
// $autoload['helper'] = array('url', 'file');
$autoload['helper'] = array('url','cookie','form','captcha','string','html','array','date','file','common');
4. 配置文件加载
// $autoload['config'] = array('config1', 'config2');
$autoload['config'] = array();
5. 语言文件加载
// $autoload['language'] = array('lang1', 'lang2');
$autoload['language'] = array();
6. 数据模型的自动加载
//$autoload['model'] = array('model1', 'model2');
$autoload['model'] = array('');
更多关于CodeIgniter相关内容感兴趣的读者可查看本站专题:《codeigniter入门教程》、《CI(CodeIgniter)框架进阶教程》、《php优秀开发框架总结》、《ThinkPHP入门教程》、《ThinkPHP常用方法总结》、《Zend FrameWork框架入门教程》、《php面向对象程序设计入门教程》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》
希望本文所述对大家基于CodeIgniter框架的PHP程序设计有所帮助。
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号