/** * save template of checklist along with some information to db * @return json content checklist */ public function actionSavecontent() { $post = Yii::$app->request->post(); $id = $post['id']; $content = $post['content']; if ($id && $content) { $checklistCow = ChecklistsCow::findOne($id); $checklistCow->content = $content; // save whole change to db if ($checklistCow->save()) { Yii::$app->response->format = 'json'; return ['errors' => '', 'data' => '']; } } return; }