Total Complexity | 6 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
15 | abstract class Base extends Widget |
||
16 | { |
||
17 | /** @var bool */ |
||
18 | public $status = true; |
||
19 | /** @var array */ |
||
20 | public $containerOptions = []; |
||
21 | /** @var array */ |
||
22 | public $clientOptions = []; |
||
23 | |||
24 | /** |
||
25 | * @inheritDoc |
||
26 | */ |
||
27 | public function init() |
||
28 | { |
||
29 | parent::init(); |
||
30 | if ($this->status === true) { |
||
31 | $this->registerAsset(); |
||
32 | } |
||
33 | $this->id = $this->id ?: $this->getId(); |
||
34 | $containerOptions = [ |
||
35 | 'id' => $this->id, |
||
36 | 'style' => 'position:relative; height:300px; width:auto;' |
||
37 | ]; |
||
38 | $this->containerOptions = ArrayHelper::merge($containerOptions, $this->containerOptions); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Run |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | public function run() |
||
47 | { |
||
48 | return Html::tag('div', '', $this->containerOptions); |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Client Options |
||
53 | * |
||
54 | * @return array |
||
55 | */ |
||
56 | public function getClientOptions() |
||
63 | ]; |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * Register Asset |
||
68 | */ |
||
69 | public function registerAsset() |
||
75 |