1

执行以下命令生成 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 中添加上面的代码

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

4

1 回答 1

0

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

AcmeDemoBundle_categories:
    resource: "@AcmeDemoBundle/Resources/config/routing/categories.yml"
    prefix:   /categories
于 2014-10-14T20:32:52.287 回答