日期:2014-05-17  浏览次数:20466 次

thinkphp3.1 与frameset的显示问题
本帖最后由 EC_jouvie 于 2013-01-23 14:18:29 编辑
本人看的是thinkphp2.1版本的视频教程,老师在演示的过程中在Index模块里面index方法中display index.html页面;index.html是一个含有frameset的框架,一切正常运行。
可是到我自己操作的时候,却出现这样的问题,页面一片空白,什么都没有。我自己用3.1版本的thinkphp.求教高手指点。
贴出代码
IndexAction.class.php
class IndexAction extends Action {
    public function index(){
$this->assign('title','标题');
$this->display();
    }
public function top(){
$this->display();
}
public function menu(){
$this->display();
}
public function main(){
$this->display();
}
public function footer(){
$this->display();
}
}

index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$title}</title>//此处的$title变量还是可以显示的
</head>
<frameset rows="50,*,40">
<frame name="top" src="http://www.baidu.com" />
    <frameset cols="200,*">
     <frame name="menu" src="__URL__/menu" />
        <frame name="main" src="__URL__/main" />
    </frameset>
    <frame name="footer" src="__URL__/footer" />
</frameset>
</html>

tpl模板目录下存在index.html、top.html、menu.html、main.html、footer.html文件 

本人用DW编辑,每次修改__URL__部分再保存index.html页面的时候就会跳出错误提示框,内容如下:
文件"F:\Website\SIM\App\Student\Tpl\Index\__URL__\footer"不存在。
这个路径明明是模板所在的路径,按理说应该是模块方法所在路径才是啊?

主要的问题就是页面无法正常显示,先解决了这个,那个路径的问题我想也就迎刃而解了,求指教,谢谢
thinkphp frameset __URL__

------解决方案--------------------
这就不太清楚了,我遇到过一次是因为 footer 文件的后缀写错了,差个l,是htm
所以你检查下你的footer.html 这个文件,因为你其他文件都找的到,路径多半是对的

------解决方案--------------------
我回去翻了下我的程序,dw 误报是正常的,但我后台页面还是能够显示出来的
我记得thinkphp 的 tpl 中 默认的模板 叫做 default,你看你不是少了这个
你看的__URL__ 的值是不是正确的