Edusoho配置路由

2021-10-19  本文已影响0人  Cute_小肥鸡

路由目录:E:\modong\Modong_Kaike\src\CustomBundle\Resources\config

custom_routing.yml
如果app.php为生产模式的话,那么配置的路由不会起作用。
生产模式:$kernel = new AppKernel('prod', false);

报错如下:

[2021-10-15 19:00:11] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "POST /kaike/ehome/manage/questionbank/create"" at E:\modong\Modong_Kaike\app\cache\prod\Jianmo\classes.php line 2108 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"POST /kaike/ehome/manage/questionbank/create\" at E:\\modong\\Modong_Kaike\\app\\cache\\prod\\Jianmo\\classes.php:2108, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at E:\\modong\\Modong_Kaike\\app\\cache\\prod\\Jianmo\\appProdProjectContainerUrlMatcher.php:11363)"} []

解决方法:将app.php的生产模式改为开发模式

$kernel = new AppKernel('dev', true); //开发模式
上一篇下一篇

猜你喜欢

热点阅读