服务器之家

服务器之家 > 正文

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

时间:2021-03-29 16:22     来源/作者:栁罗风尘

本文实例讲述了CI框架中自动加载问题。分享给大家供大家参考,具体如下:

application/config

配置文件中添加:

| 1. Packages
| 2. Libraries
| 3. Helper files
| 4. Custom config files
| 5. Language files
| 6. Models

1. 第三方库文件加载

?
1
2
// $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
$autoload['packages'] = array();

2. 系统类库加载

?
1
2
// $autoload['libraries'] = array('database', 'session', 'xmlrpc');
$autoload['libraries'] = array('database','session','form_validation','pagination','upload','curl','user_agent');

3. 帮助文件加载

?
1
2
// $autoload['helper'] = array('url', 'file');
$autoload['helper'] = array('url','cookie','form','captcha','string','html','array','date','file','common');

4. 配置文件加载

?
1
2
// $autoload['config'] = array('config1', 'config2');
$autoload['config'] = array();

5. 语言文件加载

?
1
2
// $autoload['language'] = array('lang1', 'lang2');
$autoload['language'] = array();

6. 数据模型的自动加载

?
1
2
//$autoload['model'] = array('model1', 'model2');
$autoload['model'] = array('');

希望本文所述对大家基于CodeIgniter框架的PHP程序设计有所帮助。

标签:

相关文章

热门资讯

2020微信伤感网名听哭了 让对方看到心疼的伤感网名大全
2020微信伤感网名听哭了 让对方看到心疼的伤感网名大全 2019-12-26
yue是什么意思 网络流行语yue了是什么梗
yue是什么意思 网络流行语yue了是什么梗 2020-10-11
背刺什么意思 网络词语背刺是什么梗
背刺什么意思 网络词语背刺是什么梗 2020-05-22
Intellij idea2020永久破解,亲测可用!!!
Intellij idea2020永久破解,亲测可用!!! 2020-07-29
苹果12mini价格表官网报价 iPhone12mini全版本价格汇总
苹果12mini价格表官网报价 iPhone12mini全版本价格汇总 2020-11-13
返回顶部