Symfony2 - 教义:生成:crud - 路由错误

发布于 2024-11-18 04:29:24 字数 521 浏览 10 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

随遇而安 2024-11-25 04:29:24

我最近遇到了类似的问题,谷歌搜索没有太大帮助,但给了我去哪里看的想法,无论如何,足够了。

我收到的错误如下:


在此处输入代码`致命错误:标签“not_offeringmanagement”已在/...中定义

我注意到 routing_dev.ymlrouting.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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文