How to check in symfony2 controller previous URL, like in symfony 1.x ? Something equivalent to:
$request->getReferer();
To check controller previous URL in symfony 2 :
$this->getRequest()->headers->get('referer')
In new version of symfony the request object should be injected!
public function show(Request $request)
{
$request->headers->get('referer');
//...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With