CKEditorAdmin::getView()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 9
rs 10
1
<?php
2
/**
3
 * @copyright Copyright (c) 2018 Andrey Girnik
4
 * @author Andrey Girnik <[email protected]>
5
 * @license http://opensource.org/licenses/MIT MIT License
6
 */
7
namespace Itstructure\CKEditor;
8
9
/**
10
 * Class CKEditorAdmin
11
 * Widget class for displaying CKEditor block in admin-module view template.
12
 *
13
 * @see http://docs.ckeditor.com/
14
 *
15
 * @package Itstructure\CKEditor
16
 */
17
class CKEditorAdmin extends CKEditor
18
{
19
    /**
20
     * Give ability of configure view to the module class.
21
     *
22
     * @return \yii\base\View|\yii\web\View
23
     */
24
    public function getView()
25
    {
26
        $module = \Yii::$app->controller->module;
27
28
        if (method_exists($module, 'getView')) {
29
            return $module->getView();
30
        }
31
32
        return parent::getView();
33
    }
34
}
35