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


PHP User::getStatuses方法代码示例

本文整理汇总了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>
开发者ID:Jamshid90,项目名称:dotplant2,代码行数:19,代码来源:index.php

示例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>
开发者ID:tqsq2005,项目名称:dotplant2,代码行数:22,代码来源:index.php


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