Home > Backend Development > PHP Tutorial > 关于thinkphp中的widget的开发,该怎么解决

关于thinkphp中的widget的开发,该怎么解决

WBOY
Release: 2016-06-13 12:57:34
Original
910 people have browsed it

关于thinkphp中的widget的开发
class HotkeyWidget extends Widget {
        public function render($data) {
$node=M('Hotkey');//这里是数据库表的实例化
$data=$node->limit('0,10')->select();
$data['list']=$data; 
$content = $this->renderFile ( ADDON_PATH . '/widgets/Hotkey.html', $data);
return $content;
}



我在Hotket.html中应该怎么调用HotkeyWidget 类中读取出来的数据?  如果应用到模版上面应该怎么调用?
------解决方案--------------------
会用thinkphp的,难道就不会用自定义的?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template