【发布时间】:2014-04-23 01:36:32
【问题描述】:
需要使用 URI 在 laravel 3 中发送一个 id。我知道在 L4 中它的 {whatever} 但我被这个项目的 L3 (:any) 卡住了。我不断收到 404,因为它在一个不存在的控制器“报价”中寻找它 - 我需要它来使用 Shipquote 控制器。
我试过这个:
Route::any('quotes/ship/view/(:any)', 'Shipquote@viewQuote');
...没用。我试过这个作为测试:
Route::any('quotes/ship/view/test', 'Shipquote@viewQuoteTest');
...成功了。
我也试过了:
Route::any('quotes/ship/view/(:any)', function($id)
{
return Controller::call('Shipquote@viewQuote', array($id));
});
...也没有用。尝试使用 Route::any、Route::get 和 Route::post 但仍然得到 404。
任何帮助表示赞赏
【问题讨论】:
标签: laravel http-status-code-404 laravel-routing