新聞動態

                                                                                  位置:首頁 新聞動態 常見問題

                                                                                  thinkphp6路由設置

                                                                                  新聞動態
                                                                                  2022年07月19日 閱讀:2880次

                                                                                  1、路由設置 域名/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、路由設置 域名/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+']);


                                                                                  上一篇

                                                                                  下一篇

                                                                                  亚洲中文字幕在线19页_99久久国产精品免费热7788_欧美专区日韩专区综合专区_小泽玛利亚一区_gogo999亚洲肉体艺术