Completed
Push — master ( f04bdf...03085f )
by Andrii
05:00
created

ConfigGridView   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 10
dl 0
loc 14
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A columns() 0 12 1
1
<?php
2
/**
3
 * Server module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-server
6
 * @package   hipanel-module-server
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
namespace hipanel\modules\server\grid;
11
12
use hipanel\grid\BoxedGridView;
13
use hipanel\grid\MainColumn;
14
use hipanel\modules\server\menus\ConfigActionsMenu;
15
use hiqdev\yii2\menus\grid\MenuColumn;
16
use yii\helpers\Html;
17
18
class ConfigGridView extends BoxedGridView
19
{
20
    public function columns()
21
    {
22
        return array_merge(parent::columns(), [
23
            'actions' => [
24
                'class' => MenuColumn::class,
25
                'menuClass' => ConfigActionsMenu::class,
26
            ],
27
            'name' => [
28
                'class' => MainColumn::class,
29
                'format' => 'html',
30
                'value' => function ($model) {
31
                    return Html::a($model->name, ['@config/view', 'id' => $model->id]);
32
                },
33
            ]
34
        ]);
35
    }
36
}
37