// 分析模板文件规则
if('' == $template) {
// 如果模板文件名为空 按照默认规则定位
$template = CONTROLLER_NAME . C('TMPL_FILE_DEPR') . ACTION_NAME;
}elseif(false === strpos($template, '/')){
$template = CONTROLLER_NAME . C('TMPL_FILE_DEPR') . $template;
}改进如下if('' == $template) {
// 如果模板文件名为空 按照默认规则定位
if(C('VIEW_PATH')){
$template = THEME_PATH . '/'. ACTION_NAME;
}else{
$template = CONTROLLER_NAME . C('TMPL_FILE_DEPR') . ACTION_NAME;
}
}elseif(false === strpos($template, '/')){
$template = CONTROLLER_NAME . C('TMPL_FILE_DEPR') . $template;
} 最佳答案