There is a way to get the reference page from the $ request variable. For example, if I was in myaction / mypage and click on myaction2 / mypage2 with this getReferer () method, I get ' http: // myweb / myaction / mypage .
If you are in the action method, this can be done using
public function executeMyaction(sfWebRequest $request) { $previousUrl = $request->getReferer(); ... }
if you are somewhere else, you can get a request by receiving conext
$previousUrl = $this->getContext()->getRequest()->getReferer();
For sfWebRequest methods, check the sfWebRequest API .
Note. This value may not be available using the proxy server.
Pabloks
source share