thinkphp路由分组

  • route.php
Route::group('test',[
    ':id'=>'app/api/v1.Test/index',
    ':name'=>'app/api/v1.Test/index'
])->pattern(['id'=>'\d+','name'=>'\D+']);
  • Test.php
public function index(Request $request){
        return json($request->param()) ;
    }

在这里插入图片描述
在这里插入图片描述

发布了122 篇原创文章 · 获赞 5 · 访问量 4817

猜你喜欢

转载自blog.csdn.net/weixin_41254345/article/details/104633319