简体   繁体   中英

Get the Referer name requested from http_request2 lib symfony1

I have a query, as defined in the title, how to get the getReferer() functionality, when the called page is http_request call.

This url How to get previous page route in Symfony? will work only when there is a page submit from previous page, then the $request->getReferer(); will get the value, But what if the previous page submit is a ajax call where in i will post only username, and the ajax call will respond with some code.

Requested: How to Know the previous page URL When it is http_request call

Use getPathInfoArray().

$pathinfo = $request->getPathInfoArray();
$referer = $pathinfo['HTTP_REFERER'];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM