Symfony2 - 教义:生成:crud - 路由错误
我正在使用 Symfony2 RC3,并且我有一个包含 Article 实体的 NewsBundle。
我使用以下命令为其生成了 CRUD: $ php app/consoledoctrine:generate:crud (“write”设置为 yes)。
现在,我网站上的每个页面都会抛出此错误:
Fatal error: Label 'not_admin_article_create' already defined in /usr/local/zend/apache2/htdocs/AIEF/app/cache/prod/appprodUrlMatcher.php on line 260
如果我在生成的路由 yml 文件中删除
requirements: { _method: post }
admin_article_create、admin_article_update 和 admin_article_delete,则一切正常。知道为什么吗?
I'm using Symfony2 RC3 and I have a NewsBundle that has an Article entity.
I generated crud for it using the command: $ php app/console doctrine:generate:crud (with 'write' set to yes).
Now, every page on my site throws this error:
Fatal error: Label 'not_admin_article_create' already defined in /usr/local/zend/apache2/htdocs/AIEF/app/cache/prod/appprodUrlMatcher.php on line 260
If i get rid of
requirements: { _method: post }
for admin_article_create, admin_article_update and admin_article_delete in the generated routing yml file, everything works fine. Any idea why ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最近遇到了类似的问题,谷歌搜索没有太大帮助,但给了我去哪里看的想法,无论如何,足够了。
我收到的错误如下:
在此处输入代码`致命错误:标签“not_offeringmanagement”已在/...中定义
我注意到 routing_dev.yml 和 routing.yml 中有一个重复的条目,所以基本上当你碰巧有多个配置时就会弹出这个问题。我认为 Symfony2 捆绑包生成添加了映射,但用户可能会意外地在其他地方重新配置映射。
I came across a similar issue recently, Google search wasn't much help but give me ideas of where to look, anyways enough blah blah.
The error I was getting was as follows:
enter code here`Fatal error: Label 'not _ offering management' already defined in /...
Whats I noticed was that there was a duplicate entry in routing_dev.yml and routing.yml, so basically the issue pops up when you happen to have multiple configurations. I think Symfony2 bundle generation adds mapping, but user probably accidental re-configures mapping else where.