/** * Creates a new Kindsofrecommendation model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Kindsofrecommendation(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new Professions model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Kindsofrecommendation(); $data = Yii::$app->request->post(); $model->kind = isset($data['kind']) ? $data['kind'] : ''; if ($model->save()) { return array('flag' => 1, 'msg' => 'create success!'); } else { return array('flag' => 0, 'msg' => 'create fail!'); } }