当前位置: 首页>>代码示例>>PHP>>正文


PHP User::getGenderList方法代码示例

本文整理汇总了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")})
开发者ID:daixianceng,项目名称:xiaoego.com,代码行数:31,代码来源:profile.php

示例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');
开发者ID:daixianceng,项目名称:xiaoego.com,代码行数:30,代码来源:index.php


注:本文中的common\models\User::getGenderList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。