/** * Creates a new Contacts model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionAdd() { $model = new Contacts(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['index']); } else { return $this->render('add', ['model' => $model, 'formAction' => ['contacts/add']]); } }
/** * Creates a new Contacts model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Contacts(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->contact_id]); } else { return $this->render('create', ['model' => $model]); } }