| Total Complexity | 3 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class AjaxButton extends Widget |
||
| 17 | { |
||
| 18 | public $tag = 'a'; |
||
| 19 | public $text; |
||
| 20 | public $url; |
||
| 21 | public $options = ['class' => 'btn btn-link']; |
||
| 22 | public $method = 'post'; |
||
| 23 | public $data = []; |
||
| 24 | public $confirm; |
||
| 25 | public $successCallback; |
||
| 26 | |||
| 27 | public function run() |
||
| 28 | { |
||
| 29 | $options = $this->options; |
||
| 30 | if (!isset($options['id'])) { |
||
| 31 | $options['id'] = $this->getId(); |
||
| 32 | } |
||
| 33 | |||
| 34 | echo Html::tag($this->tag, $this->text, $options); |
||
| 35 | |||
| 36 | $this->registerClientScripts(); |
||
| 37 | } |
||
| 38 | |||
| 39 | protected function registerClientScripts() |
||
| 62 | } |
||
| 63 | } |