|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
-
-
- namespace yii\bootstrap;
-
-
- class Button extends Widget
- {
-
-
- public $tagName = 'button';
-
-
- public $label = 'Button';
-
-
- public $encodeLabel = true;
-
-
-
-
- public function init()
- {
- parent::init();
- $this->clientOptions = false;
- Html::addCssClass($this->options, ['widget' => 'btn']);
- }
-
-
-
- public function run()
- {
- $this->registerPlugin('button');
- return Html::tag($this->tagName, $this->encodeLabel ? Html::encode($this->label) : $this->label, $this->options);
- }
- }
|