<?php

use yii\grid\GridView;
use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '配置';
$this->params['breadcrumbs'][] = $this->title;
?>
<?php $this->beginBlock('content-header') ?>
<?= $this->title . ' ' . Html::a('新建配置', ['create'], ['class' => 'btn btn-success']) ?>
<?php $this->endBlock() ?>
<div class="box box-success">
    <div class="box-body">
        <?= GridView::widget([
            'dataProvider' => $dataProvider,
            'columns' => [
                'id',
                'name',
                'description',
                [
                    'attribute' => 'type',
                    'value' => function ($model) {
                        return $model->getTypeList()[$model->type];
                    },
                ],
                'group',
                ['class' => 'yii\grid\ActionColumn'],
            ],
        ]); ?>
    </div>
</div>
