thinkphp6路由設(shè)置
1、路由設(shè)置 域名/cates/1.html
Route::group('cates', function () {
Route::rule('/:cid', '/cate/index');
Route::rule('/:cid', 'cate/index');
})->ext('html')->pattern(['method' => 'get', 'cid' => '\d+']);
Route::group('page', function () {
Route::rule('/:cid', '/page/index');
Route::rule('/:cid', 'page/index');
})->ext('html')->pattern(['method' => 'get', 'cid' => '\d+']);
Route::group('art', function () {
Route::rule('/:aid', '/article/index');
Route::rule('/:aid', 'Article/index');
})->ext('html')->pattern(['method' => 'get', 'aid' => '\d+']);2、路由設(shè)置 域名/cates-1.html
Route::get('cates-'.":cid", '/cate/index')->ext('html')->pattern(['method' => 'get', 'cid' => '\d+']);
Route::get('page-'.":cid", '/page/index')->ext('html')->pattern(['method' => 'get', 'cid' => '\d+']);
Route::get('art-'.":aid", 'Article/index')->ext('html')->pattern(['method' => 'get', 'aid' => '\d+']);
關(guān)鍵詞: thinkphp6路由設(shè)置
鄂公網(wǎng)安備42060002000147