/** * Creates a new Emails model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Emails(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->IdEmail]); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new Emails model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate($emp_id = null, $mode = null) { $model = new Emails(); $model->employee_id = $emp_id; $model->status = 1; if ($model->load(Yii::$app->request->post()) && $model->save()) { if ($emp_id == null) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->redirect(['employees/view', 'id' => $emp_id, 'mode' => $mode]); } } else { return $this->render('create', ['model' => $model]); } }