建立前后台公用的配置文件
在Index、Admin同级的文件夹中建一个Conf文件建一个config.php文件
<?php
return array(
'DB_HOST' => 'localhost',
'DB_NAME' => 'jxdb',
'DB_USER' => 'root',
'DB_PWD' =>''
);
?>
然后可以分别在Index,Admin的config写上自己私有的配置文件,再引用共用的配置文件
<?php
$config= array(
写上自己私有的配置项
//'配置项'=>'配置值'
);
return array_merge(include'./Conf/config.php',$config);
?>