Created
September 27, 2012 09:44
-
-
Save bakura10/3793171 to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* @return ViewModel | |
*/ | |
public function registerAction() | |
{ | |
$form = new RegisterForm(); | |
if (($result = $this->prg()) instanceof Response) { | |
return $result; | |
} elseif ($result !== false) { | |
$student = new Student(); | |
$form->bind($student); | |
$form->setData($result); | |
// STUDENT CONTIENT AUTOMATIQUEEMNT TOUTES LES DONNEES REMPLIES | |
if ($form->isValid()) { | |
$userService = $this->getUserService(); | |
$userService->register($student); | |
return $this->redirect()->toRoute('home'); | |
} | |
} | |
return new ViewModel(array( | |
'form' => $form | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment