Symfony 2 Previous URL Symfony 2 Previous URL symfony symfony

Symfony 2 Previous URL


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');        //...}