ci框架 自定义配置方法

系统自动在Application文件夹下生成的config.php文件,采用key-value关联数组的形式来存放配置项和值.为了使结构更清晰,手动新建另外一个配置文件myconfig.php,所采用的形式亦为关联数组,

$config['mod'] = array(
'api' => 'https://webapi.sms.mob.com/sms/verify',
'appkey' =>'',
);

读取方式:

$this->config->load('myconfig');
$dat = $this->config->item('mod');
print_r($dat);

posted @ 2018-09-05 18:25  千载白云  阅读(1052)  评论(0编辑  收藏  举报