/** * @param string $class * @return RedirectResponse */ public function edit($class) { $this->userDiscriminator->setClass($class); $this->controller->setContainer($this->container); $result = $this->controller->editAction($this->container->get('request')); if ($result instanceof RedirectResponse) { return $this->controller->redirect($this->controller->get('request')->getRequestUri()); } $template = $this->userDiscriminator->getTemplate('profile'); if (is_null($template)) { $template = 'FOSUserBundle:Profile:edit.html.twig'; } $form = $this->formFactory->createForm(); return $this->container->get('templating')->renderResponse($template, array('form' => $form->createView())); }