Exemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Priority::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'weight' => $this->weight]);
     $query->andFilterWhere(['like', 'title', $this->title]);
     return $dataProvider;
 }
Exemplo n.º 2
0
            $statusList = ArrayHelper::map(
                Status::find()->orderBy('weight')->asArray()->all(),
                'id',
                'title'
            );
            echo $form->field($model, 'status_id')->dropDownList([''=>''] + $statusList+[
                    Status::OPENED => \Yii::t('type', '<< Opened >>'),
                    Status::CLOSED => \Yii::t('type', '<< Closed >>'),
                ]);
        ?>
        </div>

        <div class="col-sm-4">
        <?
            $priorityList = ArrayHelper::map(
                Priority::find()->orderBy('weight')->asArray()->all(),
                'id',
                'title'
            );
            echo $form->field($model, 'priority_id')->dropDownList([''=>''] + $priorityList);
        ?>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-4">
        <?
            $typeList = ArrayHelper::map(
                Type::find()->orderBy('weight')->asArray()->all(),
                'id',
                'title'