Admin   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 12 1
1
<?php
2
3
namespace yiicod\systemparams\actions\backend;
4
5
use Yii;
6
use yiicod\base\actions\base\Action;
7
use yiicod\systemparams\models\SystemParamSearch;
8
9
/**
10
 * Creates a new model.
11
 *
12
 * @author Orlov Alexey <[email protected]>
13
 * If creation is successful, the browser will be redirected to the 'admin' page.
14
 */
15
class Admin extends Action
16
{
17
    /**
18
     * View
19
     *
20
     * @var string
21
     */
22
    public $view = '@vendor/yiicod/yii2-systemparams/views/backend/system-param/admin';
23
24
    /**
25
     * Run action
26
     */
27
    public function run()
28
    {
29
        $modelSystemParam = Yii::$app->get('systemparams')->modelMap['systemParamSearch']['class'];
30
        /** @var SystemParamSearch $searchModel */
31
        $searchModel = new $modelSystemParam();
32
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
33
34
        return $this->controller->render($this->view, [
35
            'searchModel' => $searchModel,
36
            'dataProvider' => $dataProvider,
37
        ]);
38
    }
39
}
40