想在widget中封装有查询输出的DIV块的时候,应该怎么书写解析格式呢?

浏览:643 发布日期:2013/01/21 分类:求助交流
下面的代码是我自己想当然写的,是错误的,但是如果在某一个widget中有查询,我应该如何去写,才能实现类似于action中的 $this->assign('organiger',$organiger); class NoticeWidget extends Widget{      
    public function render($data){
        $organiger = M('Organiger')->where('id=1')->find();
        $this->assign('organiger',$organiger);  
        $content = $this->renderFile($data);        
        return $content;
    }
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>