Skip to content

Instantly share code, notes, and snippets.

@bakura10
Created September 27, 2012 09:44
Show Gist options
  • Save bakura10/3793171 to your computer and use it in GitHub Desktop.
Save bakura10/3793171 to your computer and use it in GitHub Desktop.
/**
* @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