本文整理汇总了PHP中common\models\User::getUserTeams方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getUserTeams方法的具体用法?PHP User::getUserTeams怎么用?PHP User::getUserTeams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common\models\User
的用法示例。
在下文中一共展示了User::getUserTeams方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Time
use frontend\models\TeamMember;
use common\models\User;
/* @var $this yii\web\View */
/* @var $model app\models\Timesheet */
$formatter = Yii::$app->formatter;
$this->title = $formatter->asDate($model->date, 'medium');
?>
<div class="timesheet-update">
<h1 style="text-align: center;"><?php
echo Html::encode($this->title);
?>
</h1>
<br /><br /><br />
<?php
$form = ActiveForm::begin();
echo TabularForm::widget(['form' => $form, 'dataProvider' => $dataProvider, 'attributes' => ['id' => ['type' => TabularForm::INPUT_TEXT, 'columnOptions' => ['hidden' => true]], 'work_time' => ['type' => TabularForm::INPUT_TEXT, 'label' => 'Work Time (hours)', 'columnOptions' => ['width' => '3em']], 'process_id' => ['type' => TabularForm::INPUT_WIDGET, 'widgetClass' => 'kartik\\widgets\\Select2', 'options' => ['data' => ArrayHelper::map(Process::find()->orderBy('process_name')->asArray()->all(), 'id', 'process_name')], 'label' => 'Process', 'columnOptions' => ['hAlign' => 'center', 'width' => '10em']], 'team_id' => ['type' => TabularForm::INPUT_WIDGET, 'widgetClass' => 'kartik\\widgets\\Select2', 'label' => 'Team', 'options' => ['data' => ArrayHelper::map(User::getUserTeams(Yii::$app->user->identity->id), 'id', 'team_name')], 'columnOptions' => ['hAlign' => 'center']], 'work_name' => ['type' => TabularForm::INPUT_TEXT, 'label' => 'Work Details', 'columnOptions' => ['hAlign' => 'center', 'width' => '15em']], 'comment' => ['type' => TabularForm::INPUT_TEXTAREA, 'label' => 'Comment', 'columnOptions' => ['hAlign' => 'center']]]]);
?>
<div class="form-group" style="text-align: right; margin-top: 20px;">
<?php
echo Html::submitButton('Save', ['class' => 'btn btn-success']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例2: time
echo Html::encode($this->title);
?>
</h1>
<?php
if (Yii::$app->session->hasFlash('CreateTimesheetFailed')) {
?>
<div class="alert alert-danger">
Cannot create/update timesheet because it has been marked!
</div>
<?php
}
?>
<?php
echo Form::widget(['formName' => 'createForm', 'form' => $form, 'columns' => 6, 'columnOptions' => ['colSpan' => 2], 'autoGenerateColumns' => false, 'attributes' => ['date' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => 'kartik\\widgets\\DatePicker', 'options' => ['pluginOptions' => ['format' => 'yyyy-mm-dd', 'autoClose' => true], 'removeButton' => false]], 'work_time' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Work time (hours)']], 'process_name' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\Select2', 'options' => ['options' => ['placeholder' => 'Process'], 'data' => ArrayHelper::map(Process::find()->orderBy('process_name')->asArray()->all(), 'process_name', 'process_name')]], 'team_name' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\Select2', 'options' => ['options' => ['placeholder' => 'Team'], 'data' => ArrayHelper::map(User::getUserTeams(Yii::$app->user->identity->id), 'team_name', 'team_name')]], 'work_name' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Work details']], 'comment' => ['type' => Form::INPUT_TEXTAREA, 'options' => ['placeholder' => 'Comment something']]]]);
?>
<div class="form-group">
<?php
echo Html::resetButton('Reset', ['class' => 'btn btn-primary']);
?>
<?php
echo Html::submitButton('Create', ['class' => 'btn btn-success']);
?>
</div>
<?php
ActiveForm::end();