ci框架配置文件设置及使用案例

在application/config/文件夹下创建myconfig.php

myconfig.php代码如下:
<?php

$config['usergroups'] = array(
    1=>array('id'=>1,'name'=>'超级管理员'),
    2=>array('id'=>2,'name'=>'普通管理员'),
);

$config['cardtype'] = array(
    1=>'身份证',
    2=>'护照',
);

控制器中调用方法:

$this->config->load('myconfig');
$usergroups=$this->config->item('usergroups');

猜你喜欢

转载自blog.csdn.net/abiao555/article/details/109157920
今日推荐