I'm trying to redirect to the "/" route (same page) after a form submission:
/**
* @Route("/")
*/
My approach:
return $this->redirectToRoute('/');
Gives me the following error:
Unable to generate a URL for the named route "/" as such route does not exist.
you have to name the route, like:
/**
* @Route("/", name="homepage")
*/
and then:
return $this->redirectToRoute('homepage');