Plugin.php 700 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: NODELOG
  5. * Date: 16/7/4
  6. * Time: 下午1:46
  7. */
  8. namespace plugins\statistics;
  9. use yii\base\BootstrapInterface;
  10. use yii\web\View;
  11. use yii\base\Event;
  12. class Plugin extends \plugins\Plugin implements BootstrapInterface
  13. {
  14. public $info = [
  15. 'author' => 'nodelog',
  16. 'version' => 'v1.0',
  17. 'id' => 'statistics',
  18. 'name' => '第三方统计',
  19. 'description' => '第三方统计'
  20. ];
  21. public function bootstrap($app)
  22. {
  23. Event::on(View::className(), 'endBody', [$this, 'run']);
  24. }
  25. public function run()
  26. {
  27. $config = $this->getConfig();
  28. echo $config['statistics_content'];
  29. }
  30. }