Advertisement
Guest User

Untitled

a guest
May 4th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. public function actionRegister(){
  2.         $model=new RegisterForm;
  3.         if(isset($_POST['RegisterForm'])){
  4.             $model->attributes=$_POST['RegisterForm'];
  5.             if($model->validate()){
  6.                 $model1=new User;
  7.                 $model1->username = $model->name;
  8.                 $model1->password = $model->password;
  9.                 $model1->mail = $model->email;
  10.                 if($model1->save()){
  11.                     Yii::app()->user->setFlash('register','It worked!');
  12.                     $this->refresh();
  13.                 }  
  14.             }
  15.         }
  16.         $this->render('register',array('model'=>$model));
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement