我正在嘗試將URL傳遞給控制器。如何將URL作爲查詢字符串傳遞?
http://something/index.php/api/http%3A%2F%2Fengadget.com
我得到404 Not Found錯誤。
我的路線
Route::any("/api/{url}", "[email protected]");
如何配置路由或控制器,使其工作?
我正在嘗試將URL傳遞給控制器。如何將URL作爲查詢字符串傳遞?
http://something/index.php/api/http%3A%2F%2Fengadget.com
我得到404 Not Found錯誤。
我的路線
Route::any("/api/{url}", "[email protected]");
如何配置路由或控制器,使其工作?
Route::any("/api/(:all)", "[email protected]");
http://laravel.com/docs/routing#wildcards
可以使用(:全部)抓的URI
其餘如何沒有 「API」 前面的/?
你在使用Laravel 3還是4? – Anujan