CI框架中类的自动加载问题分析

所属分类: 网络编程 / PHP编程 阅读数: 231
收藏 0 赞 0 分享

本文实例讲述了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. 系统类库加载

// $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实现像JSP,ASP里Application那样的全局变量

用php实现像JSP,ASP里Application那样的全局变量
收藏 0 赞 0 分享

自动分页的不完整解决方案

自动分页的不完整解决方案
收藏 0 赞 0 分享

FCKeditor的安装(PHP)

FCKeditor的安装(PHP)
收藏 0 赞 0 分享

mysql5详细安装教程

mysql5详细安装教程
收藏 0 赞 0 分享

isset和empty的区别

isset和empty的区别
收藏 0 赞 0 分享

php5.2时间相差8小时

php5.2时间相差8小时
收藏 0 赞 0 分享

安装APACHE

安装APACHE
收藏 0 赞 0 分享

PHP5 安装方法

PHP5 安装方法
收藏 0 赞 0 分享

PHP has encountered an Access Violation

PHP has encountered an Access Violation
收藏 0 赞 0 分享

MYSQL环境变量设置方法

本文介绍了mysql数据库中环境变量的设置方法,如何设置mysql数据库的环境变量,有需要的朋友参考下
收藏 0 赞 0 分享
查看更多