本文整理汇总了PHP中app\modules\user\models\User::getStatuses方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getStatuses方法的具体用法?PHP User::getStatuses怎么用?PHP User::getStatuses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\modules\user\models\User
的用法示例。
在下文中一共展示了User::getStatuses方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
/**
* @var $dataProvider \yii\data\ActiveDataProvider
* @var $searchModel \app\components\SearchModel
* @var $this \yii\web\View
*/
use app\backend\components\ActionColumn;
use kartik\dynagrid\DynaGrid;
use kartik\helpers\Html;
use kartik\icons\Icon;
$this->title = Yii::t('app', 'Users');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">
<?php
echo DynaGrid::widget(['options' => ['id' => 'users-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], 'id', 'username', 'email:email', ['attribute' => 'status', 'filter' => \app\modules\user\models\User::getStatuses()], 'create_time:datetime', ['class' => ActionColumn::className(), 'options' => ['width' => '95px'], 'buttons' => [['url' => 'update', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'options' => ['data-action' => 'delete'], 'label' => Yii::t('app', 'Delete')]]]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/user/backend-user/update'], ['class' => 'btn btn-success']) . \app\backend\widgets\RemoveAllButton::widget(['url' => '/user/backend-user/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']])]]]);
?>
</div>
示例2: function
<?php
/**
* @var $dataProvider \yii\data\ActiveDataProvider
* @var $searchModel \app\components\SearchModel
* @var $this \yii\web\View
*/
use app\backend\components\ActionColumn;
use app\modules\user\models\User;
use kartik\dynagrid\DynaGrid;
use kartik\helpers\Html;
use kartik\icons\Icon;
$this->title = Yii::t('app', 'Users');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">
<?php
echo DynaGrid::widget(['options' => ['id' => 'users-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], 'id', 'username', 'email:email', ['attribute' => 'status', 'filter' => User::getStatuses(), 'value' => function ($data) {
return isset(User::getStatuses()[$data->status]) ? User::getStatuses()[$data->status] : $data->status;
}], 'create_time:datetime', ['class' => ActionColumn::className(), 'options' => ['width' => '95px'], 'buttons' => [['url' => 'update', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'options' => ['data-action' => 'delete'], 'label' => Yii::t('app', 'Delete')]]]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/user/backend-user/update'], ['class' => 'btn btn-success']) . \app\backend\widgets\RemoveAllButton::widget(['url' => '/user/backend-user/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']])]]]);
?>
</div>