共计 281 个字符,预计需要花费 1 分钟才能阅读完成。
在thinkphp5.1中,控制API版本可以用
Route::get('api/:version/home','api/:version.Index/home');
但是在 thinkphp6的多应用下不生效了
注意,这时 route 目录放在某个应用下,比如 放在 api 目录下
Route::rule(':version/:controller', 'api/:version.:controller/index');
Route::rule(':version/:controller/:action', 'api/:version.:controller/:action');
正文完