【问题标题】:Unable to generate a URL for the named route "sonata_admin_dashboard" as such route does not exist无法为命名路由“sonata_admin_dashboard”生成 URL,因为这样的路由不存在
【发布时间】:2014-12-06 23:33:51
【问题描述】:

完整的错误信息是:

[2014-10-12 08:07:45] request.CRITICAL:未捕获的 PHP 异常 Twig_Error_Runtime:“在呈现模板期间引发了异常(“无法为命名路由“sonata_admin_dashboard”生成 URL”因为这样的路线不存在。”)在第 104 行的“SonataAdminBundle::standard_layout.html.twig”中。”在 /Volumes/Sviluppo/web/sensorario/magna/app/cache/prod/classes.php 第 4483 行 {"exception":"[object] (Twig_Error_Runtime: 在渲染模板期间引发了异常 (\"Unable在第 104 行的 \"SonataAdminBundle::standard_layout.html.twig\" 中为命名路由 \"sonata_admin_dashboard\" 生成 URL。\") 在 /Volumes/Sviluppo/web/sensorario/ magna/app/cache/prod/classes.php:4483,Symfony\Component\Routing\Exception\RouteNotFoundException:无法为命名路由“sonata_admin_dashboard”生成 URL,因为这样的路由不存在。在 /Volumes/Sviluppo /web/sensorario/magna/app/cache/prod/appProdUrlGenerator.php:38)"} []

我只在生产环境中收到此错误。在开发环境中一切正常。

例如,路线

http://magna/admin/dashboard

返回 404,tail -f app/logs/prod.log 说:

No route found for "GET /admin/dashboard"

【问题讨论】:

    标签: php symfony sonata-admin


    【解决方案1】:

    您可能只在

    下导入了正确的路由文件
    app/config/routing_dev.yml
    

    尝试将奏鸣曲的路线导入你的

    app/config/routing.yml
    

    也是。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-07
      • 2023-03-11
      • 2014-08-23
      • 1970-01-01
      • 2016-11-03
      • 1970-01-01
      • 2018-12-15
      • 1970-01-01
      相关资源
      最近更新 更多