Exemple #1
0
 public function search($params)
 {
     $query = PogodaXXI::find()->where(['max_temp' => '']);
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     $query->andFilterWhere(['like', 'title', $this->title]);
     return $dataProvider;
 }
Exemple #2
0
 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     if ($model->load(Yii::$app->request->post())) {
         $model->title = Yii::$app->request->post('PogodaXXI')['title'];
         $model->prim = Yii::$app->request->post('PogodaXXI')['prim'];
         $model->max_temp = Yii::$app->request->post('PogodaXXI')['max_temp'];
         $model->min_temp = Yii::$app->request->post('PogodaXXI')['min_temp'];
         $model->save(false);
         $pog = PogodaXXI::find();
         $dataProvider = new ActiveDataProvider(['query' => $pog]);
         return $this->redirect(Url::toRoute('pogxxi/index'));
     } else {
         return $this->render('_form', ['model' => $model]);
     }
 }