我試圖在laravel中獲得以前的url,我已經嘗試了這樣的代碼,
echo redirect()-> back()-> getTargetUrl();
die()。
當我簡單地呼應這段代碼時,它正確地回傳了url,但當我試圖將它保存在某個變數中時,它卻不作業了
。uj5u.com熱心網友回復:
你可以在檔案中找到它
。https://laravel.com/docs/8.x/urls#accessing-the-current-url
//get the current URL without the query string...
echo url()-> current();
//獲取包括查詢字串的當前URL...
echo url()->full();
//獲得前一個請求的完整URL...
echo url()-> previous();
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/319550.html
標籤:
