/** * Creates a new Weather model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Weather(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }
/** * Помещаем данные в таблицу * по новому */ public function putDatasInTableNew() { $pogoda = new Weather(); $pogoda->chas = $this->chas; $pogoda->date = $this->date; //var_dump($pogoda->date); exit; $pogoda->atmdavlnaurst = $this->pressure; $pogoda->temp = $this->temp; $pogoda->otnvlaz = $this->humidity; $pogoda->naprvetra = $this->wind_direction; $pogoda->scorvetra = $this->wind_speed; $pogoda->balobl = 0; $pogoda->gorvid = 0; $pogoda->osad24 = 0; $pogoda->osad12 = 0; $pogoda->vyspok = 0; $pogoda->dd = $this->d; $pogoda->city_id = $this->cityId; $pogoda->save(false); }