</label> <div class="col-md-8"> <p class="form-control-static"><?php echo $model->email === null ? '(未设置)' : $model->email; ?> <?php echo Html::a('<i class="fa fa-pencil"></i>', ['/i/email'], ['title' => '设置邮箱']); ?> </p> </div> </div> <?php echo $form->field($model, 'nickname'); ?> <?php echo $form->field($model, 'gender')->dropDownList(User::getGenderList()); ?> <div class="form-group"> <div class="col-md-offset-2 col-md-8"> <?php echo Html::submitButton('<i class="fa fa-save"></i> 保存', ['class' => 'btn btn-warning', 'disabled' => true]); ?> </div> </div> <?php ActiveForm::end(); ?> </div> <?php $script = <<<SCRIPT \$("form input, form select").bind("change keypress", function() {\$(this.form).find("button").prop("disabled", false);\$(this.form).find("input").unbind("change keypress")})
use yii\grid\GridView; use yii\helpers\Url; use yii\helpers\Html; use yii\widgets\Pjax; use kartik\date\DatePicker; use common\models\User; $this->title = '用户列表'; ?> <div class="row"> <div class="col-lg-12"> <?php Pjax::begin(); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'tableOptions' => ['class' => 'table table-striped table-bordered table-center'], 'summaryOptions' => ['tag' => 'p', 'class' => 'text-right text-info'], 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'headerOptions' => ['class' => 'col-md-1']], ['attribute' => 'mobile', 'headerOptions' => ['class' => 'col-md-2'], 'filterInputOptions' => ['class' => 'form-control input-sm']], ['attribute' => 'nickname', 'headerOptions' => ['class' => 'col-md-2'], 'filterInputOptions' => ['class' => 'form-control input-sm']], ['attribute' => 'gender', 'filter' => User::getGenderList(), 'filterInputOptions' => ['class' => 'form-control input-sm'], 'headerOptions' => ['class' => 'col-md-1'], 'value' => function ($model, $key, $index, $column) { return $model->genderMsg; }], ['attribute' => 'email', 'headerOptions' => ['class' => 'col-md-2'], 'filterInputOptions' => ['class' => 'form-control input-sm']], ['attribute' => 'status', 'format' => 'raw', 'filter' => User::getStatusList(), 'filterInputOptions' => ['class' => 'form-control input-sm'], 'headerOptions' => ['class' => 'col-md-1'], 'value' => function ($model, $key, $index, $column) { return Html::dropDownList('status', $model->status, User::getStatusList(), ['data-id' => $model->id]); }], ['attribute' => 'created_at', 'format' => ['date', 'php:Y-m-d H:i'], 'filter' => DatePicker::widget(['model' => $searchModel, 'type' => DatePicker::TYPE_COMPONENT_APPEND, 'attribute' => 'date', 'options' => ['class' => 'input-sm'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]), 'headerOptions' => ['class' => 'col-md-2']], ['class' => 'yii\\grid\\ActionColumn', 'header' => '操作', 'headerOptions' => ['class' => 'col-md-1'], 'template' => '{view}']]]); ?> <?php Pjax::end(); ?> </div> </div> <?php $url = Url::to(['/user/status']); $js = <<<JS var handle = function () { var id = \$(this).attr('data-id');