Initial commit,修正
This commit is contained in:
+87
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\widgets\Pjax;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
/* @var $searchModel mdm\admin\models\searchs\Menu */
|
||||
|
||||
$this->title = Yii::t('rbac-admin', 'Menus');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="ibox-content">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('rbac-admin', '创建菜单'), ['create'], ['class' => 'btn btn-info btn-sm']) ?>
|
||||
</p>
|
||||
|
||||
<?php Pjax::begin(); ?>
|
||||
<?=
|
||||
GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
/*'options' => ['class' => 'table-responsive'],
|
||||
'tableOptions' => ['class' => 'table table-striped table_base'],*/
|
||||
|
||||
'layout' => '{items}{summary}{pager}',
|
||||
'columns' => [
|
||||
['class' => 'yii\grid\SerialColumn'],
|
||||
'name',
|
||||
[
|
||||
'attribute' => 'menuParent.name',
|
||||
'filter' => Html::activeTextInput($searchModel, 'parent_name', [
|
||||
'class' => 'form-control', 'id' => null
|
||||
]),
|
||||
'label' => Yii::t('rbac-admin', 'Parent'),
|
||||
],
|
||||
'route',
|
||||
'order',
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'header' => '操作',
|
||||
'options' => ['width' => '100px;'],
|
||||
'template' => '{view} {update} {delete}',
|
||||
'buttons' => [
|
||||
'view' => function ($url, $model) {
|
||||
return Html::a('<i class="fa fa-edit">查看</i>', $url, [
|
||||
'title' => Yii::t('app', 'view'),
|
||||
'class' => 'del btn btn-primary btn-xs',
|
||||
]);
|
||||
},
|
||||
'update' => function ($url, $model) {
|
||||
return Html::a('<i class="fa fa-unlock-alt">更新</i>', $url, [
|
||||
'title' => Yii::t('app', 'update'),
|
||||
'class' => 'del btn btn-success btn-xs',
|
||||
]);
|
||||
},
|
||||
'delete' => function ($url, $model) {
|
||||
return Html::a('<i class="fa fa-close">删除</i>', $url, [
|
||||
'title' => Yii::t('app', 'delete'),
|
||||
'class' => 'del btn btn-default btn-xs',
|
||||
]);
|
||||
}
|
||||
],
|
||||
/*'urlCreator' => function ($action, $model, $key, $index) {
|
||||
if ($action === 'view') {
|
||||
return ['view', 'id' => $model->id];
|
||||
} else if ($action === 'update') {
|
||||
return ['update', 'id' => $model->id];
|
||||
} else if ($action === 'delete') {
|
||||
return ['delete', 'id' => $model->id];
|
||||
}
|
||||
}*/
|
||||
],
|
||||
],
|
||||
|
||||
]);
|
||||
?>
|
||||
<?php Pjax::end(); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user