在开启调试trace后,"错误"那里会出现报错信息
[8] Use of undefined constant APP_TMPL_PATH - assumed 'APP_TMPL_PATH' E:\today\wamp
\www\php\thinkphp\ThinkPHP\Lib\Behavior\ContentReplaceBehavior.class.php 第 40 行.
[8] Use of undefined constant APP_TMPL_PATH - assumed 'APP_TMPL_PATH' E:\today\wamp
\www\php\thinkphp\ThinkPHP\Lib\Behavior\ContentReplaceBehavior.class.php 第 47 行.
是因为控制器还没加载视图文件,所以常量并未定义好,
因为使用的是 $this->show();方法
当我们引入视图,使用 $this->display(); 就不会出错了,所以这个问题不是问题!
写出来,因为官网搜不到这个答案,希望能帮到大家!
最佳答案