public function actionStep3() { $model = new ServiceRegistrationForm('step3'); $this->_setFormData($model); $this->_saveFormData($model); if (Yii::app()->request->isPostRequest) { $model->scenario = 'step1'; $model->clearErrors(); if (!$model->validate()) { $this->redirect(array('step1')); } $model->scenario = 'step2'; $model->clearErrors(); if (!$model->validate()) { $this->redirect(array('step2')); } $model->scenario = 'step3'; $model->clearErrors(); if ($model->save()) { SendEmail::serviceRegistrationAdmin($model); SendEmail::serviceRegistrationUser($model); unset(Yii::app()->session['service-reg']); $this->redirect(array('thankyou')); } } Yii::app()->theme = 'onehome'; $this->layout = '/layouts/onehome/1-col'; $this->pageTitle = 'Confirmation - ' . Yii::app()->params['title']; $this->render('step3', array('model' => $model)); }