mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 06:01:35 +01:00
Added messages
This commit is contained in:
parent
26c8da8b69
commit
69ea47facd
@ -42,13 +42,19 @@ class UserController extends AbstractController implements UserControllerInterfa
|
||||
'label' => 'register'
|
||||
])
|
||||
->getForm();
|
||||
$form->handleRequest($request);
|
||||
$form->handleRequest($request);
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
|
||||
$task = $form->getData();
|
||||
$entityManager = $this->getDoctrine()->getManager();
|
||||
$entityManager->persist($task);
|
||||
$entityManager->flush();
|
||||
try {
|
||||
$entityManager->flush();
|
||||
$this->addFlash('success', 'User created!');
|
||||
} catch (\Exception $exception) {
|
||||
$this->addFlash('danger', 'User could not be created!');
|
||||
$this->addFlash('info', $exception->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
return $this->render("user/register.html.twig", [
|
||||
'form' => $form->createView()
|
||||
|
Loading…
Reference in New Issue
Block a user