路由目錄:E:\modong\Modong_Kaike\src\CustomBundle\Resources\config
如果app.php為生產(chǎn)模式的話河泳,那么配置的路由不會起作用。
報錯如下:
[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的生產(chǎn)模式改為開發(fā)模式
$kernel = new AppKernel('dev', true); //開發(fā)模式