<?php echo $form->field($model, 'password')->passwordInput(); ?> <?php echo $form->field($model, 'repassword')->passwordInput(); ?> <?php echo $form->field($model, 'email')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'status')->radioList(Constants::getStatusItems()); ?> <?php echo $form->field($model, 'role')->dropDownList(Role::getAdminItems(null, false)); ?> <?php $submitText = $model->isNewRecord ? "新建" : "修改"; $closeLink = Url::to(['/user/adminuser/index']); Html::SubmitButtons($submitText, $closeLink); ?> <?php ActiveForm::end(); ?> </div>
echo Html::encode($this->title); ?> </strong> <div class="pull-right"> <?php echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . LsYii::gT('添加' . $this->title), ['/user/adminuser/create'], ['class' => 'btn btn-primary']); ?> </div> </h3> </div> <div class="user-index"> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'username', 'value' => 'username'], ['attribute' => 'email', 'value' => 'email'], ['attribute' => 'status', 'filter' => Constants::getStatusItems(), 'content' => function ($model, $key, $index, $gridView) { return Constants::getStatusItems($model->status); }], ['attribute' => 'role', 'filter' => Role::getAdminItems(), 'content' => function ($model, $key, $index, $gridView) { return Role::getAdminItems($model->role); }], ['class' => 'source\\core\\grid\\ActionColumn', 'buttons' => ['update' => function ($url, $model) { if ($model->role != 'administrator') { return Html::a('<span class="glyphicon glyphicon-edit"></span>', $url, []); } else { return ''; } }, 'delete' => function ($url, $model) { if ($model->role != 'administrator') { return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, []); } else { return ''; } }]]]]); ?>