非靜態(tài)方法getpathinfo無(wú)法靜態(tài)調(diào)用
在左側(cè)欄鏈接的狀態(tài)顯示中
使用Request::getPathInfo()=="url"?"active":“”
會(huì)提示Non-static method cant called statically
這要如何處理?
查詢過(guò)百度,通過(guò)應(yīng)用(new \Illuminate\Http\Request())->getPathInfo()
不會(huì)報(bào)錯(cuò),但卻無(wú)效果
2018-10-21
2017-10-27
request()->getPathInfo() 用這個(gè)代替試試看