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