Discuz Q 二开样例 - 添加自己的路由
- 使用指令
composer require exercisebook/discuzq-routedemo下载本库。 - 在
config/config.php中的providers添加ExerciseBook\DiscuzQRouteDemo\RouteProvider::class使得 DiscuzQ 可以正常加载本库。 - 将
route/web.php中的$route->get('/{other:.*}', 'other', \App\Http\Controller\IndexController::class);这行注释掉以确保路由不冲突。
- 官方文档: https://discuz.com/docs/api.html
- 先看
RouteProvider.php文件中的boot()函数。 - 再看
TestApiController.php。 - 最后看
TestApiSerializer.php。
- 先看
RouteProvider.php文件中的boot()函数。 - 再看
TestViewController.php。