【发布时间】:2015-05-25 02:28:21
【问题描述】:
Foo 控制器:
class FooController extends Controller {
public function index() {
return 'Index method';
}
public function create(){
return 'Create method';
}
public function show($id){
return 'show method with parameter: ' . $id;
}
public function edit($id) {}
public function update($id){}
etc..
}
路线
Route::group(['prefix' => 'foo'], function()
{
// some get, post or resource controller here..
Route::resource('/', 'FooController');
}
URI:example.dev:8000/foo
索引方法URI:example.dev:8000/foo/create
创建方法URI:example.dev:8000/foo/1
RouteCollection.php 第 145 行中的 NotFoundHttpException:URI:example.dev:8000/foo/1/edit
RouteCollection.php 第 145 行中的 NotFoundHttpException:等等。
我的应用路线
[Method] | [URI] | [Name] | [Action]
GET|HEAD| foo| foo..index| App\Http\Controllers\FooController@index
GET|HEAD| foo/create| foo..create| App\Http\Controllers\FooController@create
POST| foo| foo..store| App\Http\Controllers\FooController@store
GET|HEAD| foo/{}| foo..show| App\Http\Controllers\FooController@show
GET|HEAD| foo/{}/edit| foo..edit| App\Http\Controllers\FooController@edit
PUT| foo/{}| foo..update| App\Http\Controllers\FooController@update
PATCH| foo/{}|| App\Http\Controllers\FooController@update
DELETE| foo/{}| foo..destroy| App\Http\Controllers\FooController@destroy
我的代码有什么问题?任何意见和建议将不胜感激。提前致谢。
【问题讨论】: