I have a link: mysite/productnumber_2.html
. On this Site I have a formular in a twig template, the action of this form leads to .../createAssessment
.
In my controller I do things like save in a DB.
My question is, how can I go back to the url mysite/productnumber_2.html
?
My function in teh controller looks like this:
/**
*
* @Route(path = "/createassessment", name="create_assessment", methods = "POST")
* @param Request $request The Request object
* @return RedirectResponse
*/
public function createAssessmentAction(Request $request) {
$form = $this->createForm(new AssessmentType());
$form->handleRequest($request);
if ($form->isValid()) {
$assessment = $form->getData();
$em = $this->getDoctrine()->getManager();
$em->persist($assessment);
$em->flush();
return $this->redirect( ## WHAT DO I HAVE TO PUT HERE?? ## );
}
}