具有多个捆绑和配置级别的Symfony2路由问题

编程入门 行业动态 更新时间:2024-10-12 16:24:28
本文介绍了具有多个捆绑和配置级别的Symfony2路由问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个项目,在Symfony2中每个活动域都安排了多个捆绑软件。该项目在本地WAMP的以下域中运行:Agapp.local,具有以下 app / config / routing。 yml

I've a project with multiple bundles arranged per domain of activities in Symfony2.The project is running under the following domain one my local WAMP : Agapp.local with the following app/config/routing.yml

ag_app: resource: "@AgAppBundle/Resources/config/routing.yml" prefix: / ag_apsa: resource: "@AgApsaBundle/Resources/config/routing.yml" prefix: /apsa ag_training: resource: "@AgTrainingBundle/Resources/config/routing.yml" prefix: /training ag_intern: resource: "@AgInternBundle/Resources/config/routing.yml" prefix: /parents/intern ag_parents: resource: "@AgParentsBundle/Resources/config/routing.yml" prefix: /parents ag_circo: resource: "@AgCircoBundle/Resources/config/routing.yml" prefix: /circo ag_ecole: resource: "@AgEcoleBundle/Resources/config/routing.yml" prefix: /ecole

AgApsaBundle具有以下主要路由文件:

The AgApsaBundle has the following main routing file:

ag_apsa_homepage: path: / defaults: { _controller: AgrementApsaBundle:Apsa:index } ag_apsa: resource: "@AgrementApsaBundle/Resources/config/routing/apsa.yml" prefix: /

这是AgApsaBundle.yml内容:

And here is the AgApsaBundle.yml content:

apsa: path: / defaults: { _controller: "AgrementApsaBundle:Apsa:index" } apsa_show: path: /{id}/show defaults: { _controller: "AgApsaBundle:Apsa:show" } apsa_new: path: /new defaults: { _controller: "AgApsaBundle:Apsa:new" } apsa_create: path: /create defaults: { _controller: "AgApsaBundle:Apsa:create" } requirements: { _method: post } apsa_edit: path: /{id}/edit defaults: { _controller: "AgApsaBundle:Apsa:edit" } apsa_update: path: /{id}/update defaults: { _controller: "AgApsaBundle:Apsa:update" } requirements: { _method: post|put } apsa_delete: path: /{id}/delete defaults: { _controller: "AgApsaBundle:Apsa:delete" } requirements: { _method: post|delete }

AppKernel信息:

The AppKernel info :

新的Ag\Metiers\Etab\EcoleBundle\AgEcoleBundle(),新的Ag\Metiers\Etab \CircoBundle\AgCircoBundle(),新的Ag\Metiers\父母\ParentsBundle\AgParentsBundle(),新的Ag\Metiers\Parents\InternBundle\AgInternBundle() ,个新的Ag\Metiers\培训\TrainingBundle\AgTrainingBundle(),个新的Ag\Metiers\TrainingApsaBundle\AgApsaBundle(),个新的Ag\AppBundle\ AppAgAppBundle(),

所有路线均已正确注册并通过 router:debug 命令确认。 但是,尝试访问 AgApp.local / apsa 或与Apsa捆绑包相关的任何其他路由时,它返回 未收到数据加载网页,因为服务器未发送任何数据。,而日志中记录了找到了路由的情况。相反,尝试 AgApp.local / apsa / parents 会引发404错误。 您可能会发现日志跟踪此处

All the routes are well registered and listed ,as confirmed by the router:debug command. However, trying to access the AgApp.local/apsa or any other route related to the Apsa bundle, it returns a 'No data received Unable to load the webpage because the server sent no data.', while the log registers that a macthed route was found. On the opposite, trying a AgApp.local/apsa/parents will throw a 404 error. You may find the log trace here

我是否在路由配置中缺少某些内容?

Am i missing something in the routing configuration?

推荐答案

之后,我进行了更多研究,发现路线本身并不是问题的起因。相反,在学说中,您可以找到相关的问题此处

After , more research i found that the routes themselves were not the cause of the issue .But rather Doctrine, you can find the related question here

更多推荐

具有多个捆绑和配置级别的Symfony2路由问题

本文发布于:2023-11-25 23:17:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631742.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   路由   级别

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!