【问题标题】:Symfony2 CRUD routing FailedSymfony2 CRUD 路由失败
【发布时间】:2013-08-08 12:39:18
【问题描述】:

执行以下命令生成 CRUD 后:

php app/console generate:doctrine:crud --entity=AcmeDemoBundle:Users --format=yml

CRUD 为每个实体自动更新路由时出错。

Confirm automatic update of the Routing [yes]? yes
Importing the CRUD routes: FAILED


  The command was not able to configure everything automatically.
  You must do the following changes manually.


- Import the bundle's routing resource in the bundle routing file
  (C:\wamp\www\symfony\src\Acme\DemoBundle/Resources/config/routing.yml).

    AcmeDemoBundle_categories:
        resource: "@AcmeDemoBundle/Resources/config/routing/categories.yml"
        prefix:   /categories

我也尝试创建一个新包,但仍然出现同样的错误。所以每次我在路由文件/src/Acme/DemoBundle/Resources/config/routing.yml中添加上面的代码

有人可以建议我缺少什么吗?

【问题讨论】:

标签: symfony routing crud


【解决方案1】:

我得到了同样的结果,不知道如何让生成正常工作,但它希望您将该代码添加到您的主 routing.yml 文件中,以便它可以链接生成的路由:

AcmeDemoBundle_categories:
    resource: "@AcmeDemoBundle/Resources/config/routing/categories.yml"
    prefix:   /categories

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-19
    • 2012-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-14
    • 1970-01-01
    相关资源
    最近更新 更多