?> <?php echo $form->field($model, 'key')->textInput(['maxlength' => 64, 'readonly' => $model->isNewRecord ? false : true]); ?> <?php echo $form->field($model, 'category_id')->dropDownList($categories); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => 64]); ?> <?php echo $form->field($model, 'form')->radioList(Permission::getForms()); ?> <?php echo $form->field($model, 'options')->textarea(['rows' => 6]); ?> <?php echo $form->field($model, 'default_value')->textarea(['rows' => 6]); ?> <?php echo $form->field($model, 'note')->textarea(['rows' => 6]); ?> <div class="form-group">
<?php use yii\helpers\Html; use yii\grid\GridView; use source\LuLu; use app\modules\rbac\models\Permission; /* @var $this yii\web\View */ /* @var $searchModel app\modules\rbac\models\search\PermissionSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $categoryId = LuLu::getGetValue('category_id'); $this->title = '权限管理'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="permission-index"> <p> <?php echo Html::a('新建权限', ['create', 'category_id' => $categoryId], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'key', 'name', ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'form', 'value' => function ($model) { return Permission::getForms($model->form); }], ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>