如果在config.php定义了的参数,再从debu.php定义就无效了!
config.php
return array(
'APP_STATUS' => 'debug',
'URL_MODEL'=>2,
'DB_TYPE'=>'mysql',
'DB_HOST'=>'localhost',
'DB_NAME'=>'abcd',
'DB_USER'=>'root',
'DB_PWD'=>'123456',
'DB_PORT'=>'3306',
'DB_PREFIX'=>'xxxx_',
'SHOW_ERROR_MSG'=>true,
'VAR_PAGE' => 'page',
'APP_GROUP_LIST'=>'manage',
'DEFAULT_GROUP'=>'',
'DEFAULT_MODULE'=>'Index',
);debug.phpreturn array(
'DB_USER'=>'root',
'DB_PWD'=>'jqka',
'DB_PORT'=>'6',
'HAHA'=>'en',
);在IndexAction.class中 public function go()
{
echo C('DB_PORT');
echo C('DB_PWD');
echo C('HAHA');
die;
}输出的分别是:3306、123456、en最佳答案