Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get previous url symfony 4 in formpage

/* 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'));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #previous #url #symfony #formpage
ADD COMMENT
Topic
Name
8+3 =