title = "Frontend Menus"; $this->params['breadcrumbs'][] = Yii::t('app', 'Frontend Menus'); ?>
render('/widgets/_ibox-title') ?>
$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 = ''; for ($i = 0; $i < $model['level']; $i++) { $return .= "    "; } return $return . $model['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') ], [ 'attribute' => 'is_display', 'class' => StatusColumn::className(), 'label' => Yii::t('app', 'Is Display'), 'formName' => (new Menu)->formName() . '[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(), '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}', 'width' => '190px' ] ] ]) ?>