-
Notifications
You must be signed in to change notification settings - Fork 61
/
Widget.php
45 lines (39 loc) · 1.01 KB
/
Widget.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* @package yii2-krajee-base
* @author Kartik Visweswaran <[email protected]>
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2022
* @version 3.0.5
*/
namespace kartik\base;
use yii\base\InvalidConfigException;
use yii\base\Widget as YiiWidget;
/**
* Widget is the base class for widgets extending [[YiiWidget]] used in Krajee extensions.
*
* @author Kartik Visweswaran <[email protected]>
*/
class Widget extends YiiWidget implements BootstrapInterface
{
use TranslationTrait;
use WidgetTrait;
use BootstrapTrait;
/**
* @var array HTML attributes or other settings for widgets.
*/
public $options = [];
/**
* @inheritdoc
* @throws InvalidConfigException
*/
public function init()
{
$this->initBsVersion();
parent::init();
$this->mergeDefaultOptions();
if (empty($this->options['id'])) {
$this->options['id'] = $this->getId();
}
$this->initDestroyJs();
}
}