路由、控制器笔记

1 基础路由写法

Route::get('/index',function (){
    return 'hello word';
});
//http://127.0.0.1:8000/index

 2、match 接收指定的提交方式

Route::match(['get','post'],'match',function (){
    return 'match';
});

3 、路由中传递参数

Route::get('index/{id}',function ($id){
    return 'index'.$id;
});
//http://127.0.0.1:8000/index/abc123 返回indexabc123

猜你喜欢

转载自www.cnblogs.com/linzenews/p/12727275.html