public function actionUpdate($id) { $model = $this->findModel($id); $result = false; if (Yii::$app->request->post()) { $result = GivenTask::updateGivenTask(Yii::$app->request->post(), $model); $model = $this->findModel($id); } /* if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { */ return $this->renderAjax('update', ['model' => $model, 'result' => $result]); //} }