/** * Updates an existing Blog model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ public function actionUpdate($id) { $model = $this->findModel($id); if (Blog::saveImageAndModel($model, Yii::$app->request->post())) { return $this->redirect(['view', 'id' => $model->id]); } return $this->render('update', ['model' => $model]); }