本文整理汇总了PHP中common\models\User::getGenderList方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getGenderList方法的具体用法?PHP User::getGenderList怎么用?PHP User::getGenderList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common\models\User
的用法示例。
在下文中一共展示了User::getGenderList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
</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")})
示例2: function
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');