header 是网站的头部公共文件 。
模版文件引入public header 文件,但是header公共文件里面的幻灯片是调用数据库的,然后果断谢了PublicAction.class.php
class PublicAction extends Action {
public function header(){
$hz= M('ppt');
$ppt = $hz->where('state=0')->order('sort desc')->select();
$this->assign('ppt',$ppt);
$this->display('hz');
}
}
然后这里显示很正常http://localhost/think/index.php/Public/header
但是http://localhost/think/index.php显示的不正常
感觉这种思路应该是不对的。刚学tp
求:怎么让公共的文件在后台能控制呢?
最佳答案