/** * Creates a new HowHear model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new HowHear(); if ($model->load(Yii::$app->request->post())) { if ($model->save()) { Yii::$app->session->setFlash('successful'); echo 1; } else { echo 0; } // return $this->render('create', [ // 'model' => $model, // ]); } else { return $this->renderAjax('create', ['model' => $model]); } }