首页 > 语言 > PHP > 正文

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

2024-05-04 23:52:46
字体:
来源:转载
供稿:网友

本文实例讲述了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框架的PHP程序设计有所帮助。


注:相关教程知识阅读请移步到PHP教程频道。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选