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);

猜你喜欢

转载自www.cnblogs.com/songyanan/p/9593743.html