public function actionCreate() { if (!Yii::app()->user->isGuest) { $this->redirect($this->createUrl("/account")); return; } $error = array(); $model = new UserForm(); if (Yii::app()->request->isPostRequest) { $model->attributes = $_POST['UserForm']; if ($model->validate()) { $post = $_POST['UserForm']; $ret = $model->updateUser(); if ($ret) { Yii::app()->session['user_phone'] = Formatter::formatPhone($post['phone']); $this->redirect(Yii::app()->createUrl('/account/ActiveOtp', array('action' => 'register'))); } else { $error[] = Yii::t("wap", "Có lỗi xảy ra, vui lòng thử lại sau"); } } else { $error[] = Yii::t("wap", "Có lỗi xảy ra, vui lòng thử lại sau"); } } $this->render('create', compact('model', 'error')); }