一、问题:实现的articleStatic()方法没有把widget.html页面呈现出来。
二、插件目录
三、ArticleStaticPlugin.php类里面的articleStatic()的代码
<?php namespace plugins\article_static; use cmf\lib\Plugin; class ArticleStaticPlugin extends Plugin { public $info = [ 'name' => 'ArticleStatic',//Demo插件英文名,改成你的插件英文就行了 'title' => '博文统计', 'description' => '统计发表的文章,按年统计生成表和饼图', 'status' => 1, 'author' => 'ywz', 'version' => '1.0', 'demo_url' => 'http://demo.thinkcmf.com', 'author_url' => 'http://www.thinkcmf.com' ]; public $hasAdmin = 1;//插件是否有后台管理界面 // 插件安装 public function install() { return true;//安装成功返回true,失败false } // 插件卸载 public function uninstall() { return true;//卸载成功返回true,失败false } //实现的article_static钩子方法 //public function footerStart($param) public function articleStatic() { $config = 1000; $this->assign('config',$config); return $this->fetch('widget'); } }
四、在total.html中添加分别添加<hook name="article_static"/>和<hook name="footer_start"/>,<hook name="article_static"/>没有把内容呈现出来。
五、widget.html代码
<p>990909090</p> <p>{$config}</p>
六、疑问:
(1)添加的插件一定要使用系统的钩子方法吗?
(2)多个插件能不能对应一个系统的钩子方法?
0.话题发布后没及时显示,请联系官方QQ群管理;
1.话题支持代码,qq截屏直接粘贴,和QQ群一样;
2.问题描述清,比如服务器版本,程序版本;
3.能上代码,就不用文字;
4.把问题发到话题后再发QQ群;
5.如果感觉回复者解答的不错,可以发红包!
6.多帮助别人也是对自己的锻炼!
7.付费讨论中只有提问者和付费用户才可以查看回复
1.评论积分+1;每天最多10次奖励
2.发布话题积分+1;每天最多5次奖励
3.垃圾评论积分-500;
4.黄色,暴力,违反我国法律评论直接封号