Uzyskaj poprzedni URL Symfony 4 w formacie
/* in form */
<input type="hidden" name="referer"
value="{{app.request.headers.get('referer')}}"/>
/* in controller */
if ($form->isSubmitted() && $form->isValid()) {
$em->persist($thisEntity);
$em->flush();
return $this->redirect($request->request->get('referer'));
}
Hakamate