DemoPlugin.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: Dean <zxxjjforever@163.com>
  8. // +----------------------------------------------------------------------
  9. namespace plugins\demo;
  10. //Demo插件英文名,改成你的插件英文就行了
  11. use cmf\lib\Plugin;
  12. //Demo插件英文名,改成你的插件英文就行了
  13. class DemoPlugin extends Plugin
  14. {
  15. public $info = [
  16. 'name' => 'Demo', //Demo插件英文名,改成你的插件英文就行了
  17. 'title' => '插件演示',
  18. 'description' => '插件演示',
  19. 'status' => 1,
  20. 'author' => 'ThinkCMF',
  21. 'version' => '1.0.2',
  22. 'demo_url' => 'http://demo.thinkcmf.com',
  23. 'author_url' => 'http://www.thinkcmf.com',
  24. ];
  25. public $hasAdmin = 1; //插件是否有后台管理界面
  26. // 插件安装
  27. public function install()
  28. {
  29. return true; //安装成功返回true,失败false
  30. }
  31. // 插件卸载
  32. public function uninstall()
  33. {
  34. return true; //卸载成功返回true,失败false
  35. }
  36. //实现的footer_start钩子方法
  37. public function footerStart($param)
  38. {
  39. $config = $this->getConfig();
  40. $this->assign($config);
  41. echo $this->fetch('widget');
  42. }
  43. public function testFetch()
  44. {
  45. $config = $this->getConfig();
  46. $this->assign($config);
  47. return $this->fetch('widget');
  48. }
  49. }