1/* in form */
2<input type="hidden" name="referer"
3 value="{{app.request.headers.get('referer')}}"/>
4
5/* in controller */
6if ($form->isSubmitted() && $form->isValid()) {
7 $em->persist($thisEntity);
8 $em->flush();
9 return $this->redirect($request->request->get('referer'));
10}