= $this->render('/widgets/_ibox-title') ?>
= Bar::widget() ?>
= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'layout' => '{items}',
'columns' => [
[
'class' => CheckboxColumn::className(),
],
[
'attribute' => 'name',
'label' => Yii::t('app', 'Name'),
'format' => 'html',
'value' => function ($model, $key, $index, $column) {
return $model['prefix_level_name'];
}
],
[
'attribute' => 'icon',
'label' => Yii::t('app', 'Icon'),
'format' => 'html',
'value' => function ($model) {
return "";
}
],
[
'attribute' => 'url',
'label' => Yii::t('app', 'Url'),
'value' => function($model){
/** @var Menu $mddel */
return $model->convertJSONStringToRelativeUrl();
}
],
[
'class' => SortColumn::className(),
'primaryKey' => function($model){
return ["id" => $model["id"]];
},
'label' => Yii::t('app', 'Sort')
],
[
'class' => StatusColumn::className(),
'attribute' => 'is_display',
'formName' => (new Menu)->formName() . '[is_display]',
'label' => Yii::t('app', 'Is Display'),
'filter' => Constants::getYesNoItems()
],
[
'class' => DateColumn::className(),
'attribute' => 'created_at',
'label' => Yii::t('app', 'Created At'),
],
[
'class' => DateColumn::className(),
'attribute' => 'updated_at',
'label' => Yii::t('app', 'Updated At'),
],
[
'class' => ActionColumn::className(),
'width' => '190px',
'buttons' => [
'create' => function ($url, $model, $key) {
return Html::a(' ', Url::to([
'create',
'parent_id' => $model['id']
]), [
'title' => Yii::t('app', 'Create'),
'data-pjax' => '0',
'class' => 'btn-sm J_menuItem',
]);
}
],
'template' => '{create} {view-layer} {update} {delete}',
]
]
]) ?>