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


PHP User::getStatuses方法代码示例

本文整理汇总了PHP中app\models\User::getStatuses方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getStatuses方法的具体用法?PHP User::getStatuses怎么用?PHP User::getStatuses使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\User的用法示例。


在下文中一共展示了User::getStatuses方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionIndex

 public function actionIndex()
 {
     $userSearch = new UserSearch();
     $dataProvider = $userSearch->search(Yii::$app->request->get());
     $statuses = User::getStatuses();
     return $this->render('index', ['userSearch' => $userSearch, 'dataProvider' => $dataProvider, 'statuses' => $statuses, 'roles' => Yii::$app->authManager->getRoles()]);
 }
开发者ID:rkit,项目名称:bootstrap-yii2,代码行数:7,代码来源:UsersController.php

示例2: testGetStatuses

 public function testGetStatuses()
 {
     $user = new User();
     $statuses = $user->getStatuses();
     expect_that(is_array($statuses));
     expect(count($statuses))->equals(3);
 }
开发者ID:rkit,项目名称:bootstrap-yii2,代码行数:7,代码来源:UserTest.php

示例3: edit

 public function edit(User $user)
 {
     $roles = Role::lists('name', 'id');
     return view('backend.users.edit')->with('user', $user)->with('statuses', User::getStatuses())->with('roles', $roles);
 }
开发者ID:AlexYaroma,项目名称:mightyducks,代码行数:5,代码来源:UsersController.php

示例4:

<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\models\User */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="user-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'status')->dropDownList(\app\models\User::getStatuses());
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
开发者ID:nuclearman,项目名称:yiifeed,代码行数:30,代码来源:_form.php

示例5: array

<?php

$actions = array('index' => 'View All', 'create' => 'New User');
$menu = array();
foreach ($actions as $action => $label) {
    $menu[] = array('url' => array('users', $action), 'label' => $label, 'htmlOptions' => $action == $this->getActiveAction() ? array('class' => 'selected') : array());
}
echo \app\components\htmltools\Page::title('Users - ' . $actions[$this->getActiveAction()], $menu);
\mpf\widgets\datatable\Table::get(array('dataProvider' => $model->getDataProvider(), 'multiSelect' => true, 'multiSelectActions' => array('delete' => ['label' => 'Delete', 'icon' => \mpf\web\AssetsPublisher::get()->mpfAssetFile('images/oxygen/16x16/actions/edit-delete.png'), 'shortcut' => 'Shift+Delete', 'url' => \mpf\WebApp::get()->request()->createURL("users", "delete"), 'confirmation' => 'Are you sure?'], 'enable' => ['label' => 'Enable', 'icon' => \mpf\web\AssetsPublisher::get()->mpfAssetFile('images/oxygen/16x16/actions/dialog-ok-apply.png'), 'url' => \mpf\WebApp::get()->request()->createURL("users", "index")], 'disable' => ['label' => 'Disable', 'icon' => \mpf\web\AssetsPublisher::get()->mpfAssetFile('images/oxygen/16x16/actions/dialog-cancel.png'), 'url' => \mpf\WebApp::get()->request()->createURL("users", "index")], 'join' => ['label' => 'Join Accounts', 'icon' => \mpf\web\AssetsPublisher::get()->mpfAssetFile('images/oxygen/16x16/actions/im-msn.png'), 'url' => \mpf\WebApp::get()->request()->createURL("users", "merge"), 'confirmation' => 'Are you sure? After this user can log in on any of those accounts and see data from all of them.[where this is supported]']), 'columns' => array('name', 'email', 'register_date' => array('class' => 'Date'), 'last_login' => array('class' => 'Date'), 'last_login_source' => array('filter' => array('post' => 'POST', 'cookie' => 'Cookie', 'facebook' => 'Facebook', 'google' => 'Google')), 'status' => array('class' => 'Select', 'filter' => \app\models\User::getStatuses()), array('class' => 'Actions', 'buttons' => array('delete' => array('class' => 'Delete'), 'edit' => array('class' => 'Edit'), 'view' => array('class' => 'View')), 'headerHtmlOptions' => array('style' => 'width:60px;'), 'topButtons' => array('add' => array('class' => 'Add'))))))->display();
开发者ID:mpf-soft,项目名称:app-basic,代码行数:9,代码来源:index.php

示例6: rules

 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['username', 'email', 'ip', 'role'], 'string'], ['date_create', 'date', 'format' => 'yyyy-mm-dd'], ['status', 'integer'], ['status', 'in', 'range' => array_keys(User::getStatuses())]];
 }
开发者ID:rkit,项目名称:bootstrap-yii2,代码行数:7,代码来源:UserSearch.php


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