コード例 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = CsIndustryProperties::find();
     // add conditions that should always apply here
     $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;
     }
     // grid filtering conditions
     $query->andFilterWhere(['id' => $this->id, 'industry_id' => $this->industry_id, 'property_id' => $this->property_id, 'value_min' => $this->value_min, 'value_max' => $this->value_max, 'step' => $this->step, 'display_order' => $this->display_order, 'multiple_values' => $this->multiple_values, 'read_only' => $this->read_only, 'required' => $this->required]);
     $query->andFilterWhere(['like', 'value_default', $this->value_default])->andFilterWhere(['like', 'pattern', $this->pattern]);
     return $dataProvider;
 }
コード例 #2
0
 /**
  * Displays a single CsProperties model.
  * @param integer $id
  * @return mixed
  */
 public function actionView($id)
 {
     return $this->render('view', ['model' => $this->findModel($id), 'propertyValues' => new ActiveDataProvider(['query' => CsPropertyValues::find()->filterWhere(['property_id' => $id])]), 'industryProperties' => new ActiveDataProvider(['query' => CsIndustryProperties::find()->filterWhere(['property_id' => $id])]), 'actionProperties' => new ActiveDataProvider(['query' => CsActionProperties::find()->filterWhere(['property_id' => $id])]), 'objectProperties' => new ActiveDataProvider(['query' => CsObjectProperties::find()->filterWhere(['property_id' => $id])])]);
 }