Symfony2 CRUD路由失败

时间:2013-08-08 12:39:19

标签: symfony routing crud

执行以下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

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

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

1 个答案:

答案 0 :(得分:0)

我得到同样的东西,不知道如何让代码正常工作但是它希望你将代码添加到你的主要routing.yml文件中,以便它可以链接生成的路径:

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