+ -
当前位置:首页 → 问答吧 → 项目函数库加载后,提示错误模板不存在模板

项目函数库加载后,提示错误模板不存在模板

时间:2011-10-13

来源:互联网

首先,我的项目未作分组
在项目的common目录中创建了一个common.php文件,系统自动加载后,提示我模板未找到

项目目录结构如下

APP/
      Common/
                    common.php

      Lib/
            Action/
                     NameAction.class.php

      Tpl/
          default/
                    public/
                             nameindex.html

NameAction.class.php中调用模板的代码是:
  1. $this->display("public:nameindex");
复制代码
提示的错误信息是:
  1. 模板不存在[./APP/Tpl/default/public/name.html]
复制代码
[TRACE]
  1. [11-10-13 15:46:10] D:\wamp\www\Myapp\APP\Runtime\~runtime.php (2) View->parseTemplateFile(public:name)
  2. [11-10-13 15:46:10]
  3. D:\wamp\www\Myapp\APP\Runtime\
  4. ~runtime.php (2) View->fetch(public:teacher, , text/html, 1)
  5. [11-10-13 15:46:10]
  6. D:\wamp\www\Myapp\APP\Runtime\
  7. ~runtime.php (2) View->display(public:teacher, , text/html)
  8. [11-10-13 15:46:10]
  9. D:\wamp\www\Myapp\APP
  10. \Lib\Action\NameAction.class.php (22) Action->display(public:name)
  11. [11-10-13 15:46:10] () NameAction->index()
  12. [11-10-13 15:46:10]
  13. D:\wamp\www\Myapp\APP

  14. \Runtime\~runtime.php (2) call_user_func(Array)
  15. [11-10-13 15:46:10]
  16. D:\wamp\www\Myapp\APP

  17. \Runtime\~runtime.php (2) App::exec()
  18. [11-10-13 15:46:10] D:\wamp\www\Myapp\index.php (8) App::run()
复制代码
我想的是正常应该对应nameindex.html文件,在未创建common.php之前都是可以的,为什么加载了以后就不行了呢?
哪位朋友遇到过这样的问题,还请帮助指点一二

作者: comeon2122   发布时间: 2011-10-13

你的页面Trace信息显示的是
NameAction.class.php (22) Action->display(public:name)
并不是你上面说的public:nameindex

作者: thinkphp   发布时间: 2011-10-13

工作不细心造成的,低级失误
非常抱歉
粘贴代码的时候,竟然多粘了一个之前的同样的语句
改代码的时候,竟然一直也没注意这行代码
谢谢老大!!!!

作者: comeon2122   发布时间: 2011-10-13