public function signupAction(Request $request) { $user = new User(); $signup = new SignupAction($this->app); $form = $this->app['form.factory']->create(new SignupType(), $user); if ($request->getMethod() == "POST") { $form->handleRequest($request); if ($form->isValid()) { $signup->handle($user); return $this->app['twig']->render('success.html'); } else { return $this->app['twig']->render('signup.html', array('form' => $form->createView())); } } else { return $this->app['twig']->render('signup.html', array('form' => $form->createView())); } }
public function signupAction(Request $request) { $user = new User(); $signup = new SignupAction($this->app); $categories = GetAllCategoriesHelper::help(1); $form = $this->app['form.factory']->create(new SignupType(), $user); if ($request->getMethod() == "POST") { $form->handleRequest($request); if ($form->isValid()) { $signup->handle($user); return $this->app['twig']->render('success.html', ['categories' => $categories]); } else { return $this->app['twig']->render('signup.html', ['form' => $form->createView(), 'categories' => $categories]); } } else { return $this->app['twig']->render('signup.html', ['form' => $form->createView(), 'categories' => $categories]); } }