Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function registerAction(Request $request)
- {
- $user = new User();
- $form = $this->createForm(UserType::class, $user);
- $form->handleRequest($request);
- if ($form->isSubmitted() and $form->isValid()) {
- $confirmPassword = $request->request->get('confirmPassword');
- try{
- $this->userService->register($user, $confirmPassword);
- }catch (Exception $exception){
- $this->addFlash('message', $exception->getMessage());
- }
- return $this->redirectToRoute("index");
- }
- return $this->render("user/register.html.twig", [
- 'form' => $form->createView()
- ]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement