TP5使用方式
Route::get
Route::post
Route::put
Route::delete
Route::resource
5.0支持设置RESTFul
请求的资源路由,方式如下:
Route::resource('blog','index/blog');
设置后会自动注册7个路由规则,如下:
标识 | 请求类型 | 生成路由规则 | 对应操作方法(默认) |
---|---|---|---|
index | GET | blog | index |
create | GET | blog/create | create |
save | POST | blog | save |
read | GET | blog/:id | read |
edit | GET | blog/:id/edit | edit |
update | PUT | blog/:id | update |
delete | DELETE | blog/:id | delete |