Ejemplo n.º 1
0
 public function init()
 {
     parent::init();
     $this->contentOptions = ['class' => 'align-center'];
     $this->content = function ($model, $key, $index, $gridView) {
         return Constants::getStatusItems($model->status);
     };
 }
Ejemplo n.º 2
0
    <?php 
echo $form->field($model, 'url')->textInput(['maxlength' => 512]);
?>

    <?php 
echo $form->field($model, 'target')->radioList(Constants::getTargetItems());
?>

    

    <?php 
echo $form->field($model, 'thumb')->fileInput(['class' => 'da-custom-file']);
?>
    <?php 
echo $form->field($model, 'description')->textarea(['maxlength' => 512]);
?>

    

    <?php 
echo $form->field($model, 'sort_num')->textInput();
?>
    
    <?php 
echo $form->field($model, 'status')->radioList(Constants::getStatusItems());
?>

    <?php 
echo $form->defaultButtons();
ActiveForm::end();
Ejemplo n.º 3
0
use source\models\User;
use source\libs\Constants;
use source\modules\rbac\models\Role;
/* @var $this yii\web\View */
/* @var $searchModel source\models\search\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = '注册会员';
echo source\libs\Message::getMessage();
?>
<div class="page-header">
    <h3>
        <strong><?php 
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/member/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', 'value' => 'role', 'filter' => Role::getMemberItems()], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Ejemplo n.º 4
0
 public function getStatusText()
 {
     return Constants::getStatusItems($this->status);
 }