Example #1
0
 /**
  * Register
  */
 public function anyRegister()
 {
     $user = new User();
     $profile = new Profile();
     // process POST
     if ($_POST) {
         // check for valid data
         // typecast to prevent error (if there are no profile fields)
         $userValidate = $user->fillValidateRegister(Input::get("User"));
         $profileValidate = $profile->fillValidateRegister((array) Input::get("Profile"));
         if ($userValidate and $profileValidate) {
             // register account
             $this->_register($user, $profile);
             // set success and reload page
             Session::flash("success", $user);
             return Redirect::to(Request::path());
         }
     }
     return View::make("user.register", array("user" => $user, "profile" => $profile));
 }