本文整理汇总了PHP中app\models\Project::getOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::getOptions方法的具体用法?PHP Project::getOptions怎么用?PHP Project::getOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Project
的用法示例。
在下文中一共展示了Project::getOptions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
<?php
if (Yii::$app->user->isGuest) {
?>
<?php
echo Html::img('/uploads/settings/app_logo/' . $this->params['appSettings']['app_logo'], ['class' => 'img-thumbnail', 'width' => 300]);
?>
<br/>
<?php
echo HtmlPurifier::process($this->params['appSettings']['app_description']);
?>
<?php
} else {
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'layout' => '{items} {pager}', 'columns' => [['attribute' => 'project_id', 'filter' => Project::getOptions(), 'value' => function ($data) {
return $data->project->title;
}], ['attribute' => 'status_id', 'filter' => StatusEnum::i()->getMap(), 'value' => function ($data) {
return StatusEnum::i()->getMap()[$data->status_id];
}], ['attribute' => 'priority_id', 'filter' => PriorityEnum::i()->getMap(), 'value' => function ($data) {
return PriorityEnum::i()->getMap()[$data->priority_id];
}], ['attribute' => 'subject', 'format' => 'raw', 'value' => function ($data) {
$additionalLinks = '';
$checkList = '';
if ($data->creator_id == \Yii::$app->user->id || \Yii::$app->user->can('adminDashboard')) {
$additionalLinks = '<span class="pull-right">' . Html::a('<i class="fa fa-edit"></i>', ['/issue/update', 'id' => $data->id]) . ' ';
$additionalLinks .= Html::a('<i class="fa fa-trash"></i>', ['/issue/delete', 'id' => $data->id], ['class' => 'confirmLink']) . '</span>';
}
if ($data->checkLists) {
$checkList = '<span class="label label-success" data-toggle="tooltip" title="' . \Yii::t('app', 'Checklist') . '">
<i class="fa fa-th-list"></i> ' . $data->offListItems . '/' . $data->checkListsCount . '</span>';
示例2:
use yii\helpers\Html;
use yii\helpers\Url;
use yii\jui\DatePicker;
/* @var $model app\models\Issue */
$this->title = \Yii::t('app', 'New Issue') . ' - ' . $this->params['appSettings']['app_name'];
?>
<h1><?php
echo \Yii::t('app', 'New Issue');
?>
</h1>
<?php
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
<?php
echo $form->field($model, 'project_id')->dropDownList(\app\models\Project::getOptions());
echo $form->field($model, 'tracker_id')->dropDownList(\app\components\enums\TrackerEnum::i()->getMap());
echo $form->field($model, 'subject');
?>
<div class="row">
<div class="col-sm-6">
<?php
echo $form->field($model, 'description')->widget(Widget::classname(), ['settings' => ['lang' => 'ru', 'minHeight' => 200, 'pastePlainText' => true, 'buttonSource' => true, 'plugins' => ['clips', 'fullscreen']]]);
?>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="qwe" class="control-label"><?php
echo \Yii::t('app', 'Checklist');
?>
</label>