class IndexAction extends Action{
Public function _initialize(){
C('TEMPLATE_NAME','./views/admin/');
}
public function index(){
$this->display('index');
}
}display() 仍然是默认路径!在\ThinkPHP\Lib\Behavior\LocationTemplateBehavior.class.php文件中
dump(C('TEMPLATE_NAME')); //输出的也是默认值!
之前在2.1版本中使用的是C('TMPL_FILE_NAME')是可以在Action中动态配置的。
最佳答案