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


PHP User::getAll方法代码示例

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


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

示例1: actionList

 public function actionList()
 {
     $users = User::getAll();
     foreach ($users as $k => $v) {
         if ($v->id) {
             $account[] = $v->findAccount();
         }
     }
     return $this->render('list', ['users' => $users]);
 }
开发者ID:auchalet,项目名称:Yii-Echos-Lbres,代码行数:10,代码来源:UserController.php

示例2:

                <div class="row">
                    <div class="col-sm-6">
                        <?php 
echo $form->field($model, 'attachment')->textInput(['maxlength' => true]);
?>
                    </div>
                    <div class="col-sm-6">
                        <?php 
echo $form->field($model, 'created_ip')->textInput(['maxlength' => true]);
?>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <?php 
echo $form->field($model, 'for_user_id')->widget(Select2::classname(), ['language' => 'ru', 'data' => User::getAll(), 'options' => ['placeholder' => '', 'id' => 'for_user_id'], 'pluginOptions' => ['allowClear' => true]]);
?>
                    </div>
                    <div class="col-sm-6">
                        <?php 
echo $form->field($model, 'for_document_id')->widget(Select2::classname(), ['language' => 'ru', 'data' => Document::getAll(), 'options' => ['placeholder' => '', 'id' => 'for_document_id'], 'pluginOptions' => ['allowClear' => true]]);
?>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <?php 
echo $form->field($model, 'parent_message_id')->textInput(['maxlength' => true]);
?>
                    </div>
                    <?php 
开发者ID:darkffh,项目名称:yii2-lowbase,代码行数:31,代码来源:_search.php

示例3:

    case 5:
        // Текст
        echo "<div class='{$class}'><div>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . "</div><div>" . Html::activeTextarea($model, $option, $options_attributes) . "</div><div class='help-block'>" . $error . "</div></div>";
        break;
    case 6:
        // Файл (выбор)
        echo "<div class='{$class}'><div>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . "</div><div>" . InputFile::widget(['language' => 'ru', 'controller' => 'elfinder', 'filter' => 'image', 'template' => '<div class="input-group">
                                        {input}<span class="input-group-btn">{button}</span>
                                    </div>', 'options' => $options_attributes, 'buttonOptions' => ['class' => 'btn btn-default'], 'buttonName' => 'Выбрать файл', 'name' => 'Document[option_' . $i . ']', 'value' => $model->{$option}]) . "</div><div class='help-block'>" . $error . "</div></div>";
        break;
    case 7:
        // Изображение (загрузка)
        echo "<div class='{$class}'>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . FileInput::widget(['model' => $model, 'attribute' => $option_file, 'pluginOptions' => ['browseClass' => 'btn btn-default', 'browseLabel' => 'Загрузить файл', 'removeLabel' => 'Удалить', 'removeClass' => 'btn btn-default', 'browseIcon' => '', 'removeIcon' => '', 'showUpload' => false]]) . Html::activeHiddenInput($model, $option_file, $options_attributes);
        if (!$model->isNewRecord && $model->{$option} && $model->last_template_id == $model->template_id) {
            echo Html::img($model->{$option}, ['class' => 'doc_img img-thumbnail']) . "<p>" . Html::a('Удалить изображение', ['/document/deleteimg', 'document_id' => $model->id, 'option_id' => $i], ['class' => 'lnk delete_photo']) . "</p>";
        }
        echo "<div class='help-block'>" . $error . "</div></div>";
        break;
    case 8:
        // Список дочерних документов
        echo "<div class='{$class}'>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . Select2::widget(['model' => $model, 'attribute' => $option, 'data' => Document::getChilds($template->{$option_param}, true), 'options' => ['placeholder' => ''], 'pluginOptions' => $options_attributes]) . "<div class='help-block'>" . $error . "</div></div>";
        break;
    case 9:
        // Список потомков документов
        echo "<div class='{$class}'>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . Select2::widget(['model' => $model, 'attribute' => $option, 'data' => Document::getChilds($template->{$option_param}, false), 'options' => ['placeholder' => ''], 'pluginOptions' => $options_attributes]) . "<div class='help-block'>" . $error . "</div></div>";
        break;
    case 10:
        // Список пользователя
        echo "<div class='{$class}'>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . Select2::widget(['model' => $model, 'attribute' => $option, 'data' => User::getAll(), 'options' => ['placeholder' => ''], 'pluginOptions' => $options_attributes]) . "<div class='help-block'>" . $error . "</div></div>";
        break;
}
开发者ID:darkffh,项目名称:yii2-lowbase,代码行数:31,代码来源:_option.php

示例4: function

}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => Document::getAll(), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => ' ', 'class' => 'form-control']], ['attribute' => 'for_user_id', 'value' => function ($model) {
    $return = '';
    if ($model->for_user_id) {
        if (isset($model->forUser)) {
            $user = $model->forUser;
            $return = $user->first_name;
            if ($user->last_name) {
                $return .= " " . $user->last_name;
            }
        }
        $return .= " (" . $model->for_user_id . ")";
        return $return;
    } else {
        return null;
    }
}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => User::getAll(), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => ' ', 'class' => 'form-control'], 'format' => 'raw'], ['attribute' => 'parent_message_id', 'width' => '70px'], ['attribute' => 'created_at', 'value' => function ($model) {
    return CFF::FormatData($model->created_at, true);
}, 'width' => '200px', 'filter' => DatePicker::widget(['value' => isset($_GET['DocumentSearch']['created_at']) ? $_GET['DocumentSearch']['created_at'] : null, 'name' => 'DocumentSearch[created_at]', 'type' => DatePicker::TYPE_COMPONENT_APPEND, 'pluginOptions' => ['format' => 'dd.mm.yyyy', 'todayHighlight' => true]])], ['attribute' => 'created_user_name', 'format' => 'html', 'value' => function ($model) {
    if ($model->created_user_name) {
        return $model->created_user_name . " <span class='node-id'>(" . $model->created_user_id . ")</span>";
    } else {
        return null;
    }
}], ['attribute' => 'status', 'vAlign' => 'middle', 'format' => 'raw', 'value' => function ($model) {
    switch ($model->status) {
        case Message::STATUS_BLOCKED:
            return '<span class="label label-danger">
                        <i class="glyphicon glyphicon-lock"></i> ' . Message::getStatuses()[$model->status] . '</span>';
            break;
        case Message::STATUS_ACTIVE:
            return '<span class="label label-success">
开发者ID:darkffh,项目名称:yii2-lowbase,代码行数:31,代码来源:index.php


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