tp6多应用模式下路由怎么写才能省略应用部分?

浏览:1624 发布日期:2019/07/17 分类:求助交流 关键字: tp6 thinkphp6 Route 路由
tp6多应用模式下路由怎么写才能省略应用部分?

以下是\route\index\route.php路由文件的内容use think\facade\Route;

//首页
Route::rule('/','Index/index');

//新闻
Route::group('/news', function () {
    Route::get('list-<id>', 'lst')->name('new_list');
    Route::get(':id', 'index/:id');
})->prefix('News/')->ext('html')->pattern(['id' => '\d+']);
这样能匹配到
/index/news/list-5.html
但是怎么才能省略index部分变成
/news/list-5.html
呢?
跪求大神解答
最佳答案
评论( 相关
后面还有条评论,点击查看>>