mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 14:07:25 +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'
|
'label' => 'register'
|
||||||
])
|
])
|
||||||
->getForm();
|
->getForm();
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
|
|
||||||
$task = $form->getData();
|
$task = $form->getData();
|
||||||
$entityManager = $this->getDoctrine()->getManager();
|
$entityManager = $this->getDoctrine()->getManager();
|
||||||
$entityManager->persist($task);
|
$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", [
|
return $this->render("user/register.html.twig", [
|
||||||
'form' => $form->createView()
|
'form' => $form->createView()
|
||||||
|
Loading…
Reference in New Issue
Block a user