TP3.1开启 Trace后,提示 APP_TMPL_PATH 错误!

浏览:762 发布日期:2014/08/18 分类:技术分享 关键字: APP_TMPL_PATH
tp的trace界面让我们很容易调试,但是刚开始学的时候,有个小纠结的地方:

在开启调试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(); 就不会出错了,所以这个问题不是问题!
写出来,因为官网搜不到这个答案,希望能帮到大家!
最佳答案
评论( 相关
后面还有条评论,点击查看>>