1 | <?php |
||
21 | class CKEditor extends InputWidget |
||
22 | { |
||
23 | use CKEditorTrait; |
||
24 | |||
25 | /** |
||
26 | * @inheritdoc |
||
27 | */ |
||
28 | 6 | public function init() |
|
29 | { |
||
30 | 6 | parent::init(); |
|
31 | 6 | $this->initOptions(); |
|
32 | 6 | } |
|
33 | |||
34 | /** |
||
35 | * @inheritdoc |
||
36 | */ |
||
37 | 2 | public function run() |
|
38 | { |
||
39 | 2 | if ($this->hasModel()) { |
|
40 | 1 | echo Html::activeTextarea($this->model, $this->attribute, $this->options); |
|
41 | 1 | } else { |
|
42 | 1 | echo Html::textarea($this->name, $this->value, $this->options); |
|
43 | } |
||
44 | 2 | $this->registerPlugin(); |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * Registers CKEditor plugin |
||
49 | * @codeCoverageIgnore |
||
50 | */ |
||
51 | protected function registerPlugin() |
||
74 | } |
||
75 |