-
-
Save kirs/1208036 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function actionRegistr() | |
{ | |
$form = new RegistrForm; | |
if (!Yii::app()->user->isGuest) { | |
throw new CException('Вы уже зарегистрированны!'); | |
} else { | |
if (isset($_POST['RegistrForm'])) { | |
$form->attributes = $_POST['RegistrForm']; | |
$form->verifyCode = $_POST['RegistrForm']['verifyCode']; | |
if($form->validate()) { | |
$model = new User; | |
$model->attributes = $form->attributes; | |
// Выводим страницу что "все окей" | |
$model->save(); | |
$this->render('registr_ok'); | |
} | |
} else { | |
$this->render('registr', array('form' => $form)); | |
} | |
} else { | |
$this->render('registr', array('form' => $form)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment