简体   繁体   中英

Unable to generate a URL for the named route “sonata_admin_dashboard” as such route does not exist

Complete error message is:

[2014-10-12 08:07:45] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "sonata_admin_dashboard" as such route does not exist.") in "SonataAdminBundle::standard_layout.html.twig" at line 104." at /Volumes/Sviluppo/web/sensorario/magna/app/cache/prod/classes.php line 4483 {"exception":"[object] (Twig_Error_Runtime: An exception has been thrown during the rendering of a template (\\"Unable to generate a URL for the named route \\"sonata_admin_dashboard\\" as such route does not exist.\\") in \\"SonataAdminBundle::standard_layout.html.twig\\" at line 104. at /Volumes/Sviluppo/web/sensorario/magna/app/cache/prod/classes.php:4483, Symfony\\Component\\Routing\\Exception\\RouteNotFoundException: Unable to generate a URL for the named route \\"sonata_admin_dashboard\\" as such route does not exist. at /Volumes/Sviluppo/web/sensorario/magna/app/cache/prod/appProdUrlGenerator.php:38)"} []

I get this error only in production environment. In dev environment all works fine.

And, for example, route

http://magna/admin/dashboard

returns 404, and tail -f app/logs/prod.log says:

No route found for "GET /admin/dashboard"

You might have only imported the proper routing file under

app/config/routing_dev.yml

Try to import Sonata's routes in your

app/config/routing.yml

as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM