2

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

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:   /

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 }  

The AppKernel info :

new Ag\Metiers\Etab\EcoleBundle\AgEcoleBundle(), new Ag\Metiers\Etab\CircoBundle\AgCircoBundle(), new Ag\Metiers\Parents\ParentsBundle\AgParentsBundle(), new Ag\Metiers\Parents\InternBundle\AgInternBundle(), new Ag\Metiers\Training\TrainingBundle\AgTrainingBundle(), new Ag\Metiers\TrainingApsaBundle\AgApsaBundle(), new Ag\AppBundle\AgAppBundle(),

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?

Raymond A
  • 763
  • 1
  • 12
  • 29
  • 1
    Are you sure the log is matching the right route? Look for the kernel info level of symfony to check the matched route. Since you are using WAMP I can imagine you have some problems with rewriting! – Renato Mefi Dec 14 '15 at 14:35
  • `[2015-12-14 15:39:35] request.INFO: Matched route "ag_apsa_homepage" (parameters: "_controller": "Ag\Metiers\Training\ApsaBundle\Controller\ApsaController::indexAction", "_route": "ag_apsa_homepage") [] []` Yes, they're defined appropriately in the kernel (see updated question) – Raymond A Dec 14 '15 at 14:52
  • 1
    Can you try access `AgApp.local/apsa/` with the ending slash and tell me if you land in your action? – Renato Mefi Dec 14 '15 at 15:08
  • It returns the same result , as in the route is found wth the appropriate Action (from the Logs) but nothing is returned – Raymond A Dec 14 '15 at 15:13
  • 1
    Ok. as I see you really have a configuration issue since you have multiple prefixes in each level of your configurations. I would recommend you to move the specific route to `app/config/routing.yml` just for test, and then you try to move it to the bundle specific configuration. Remeber to comment/remove the bundle reference while testing this – Renato Mefi Dec 14 '15 at 15:16
  • When i move the specific route inside the bundle i get a 404 error on the route. However, should i put the route into the `app\config` it returns nothing (As the question above). – Raymond A Dec 14 '15 at 15:28

1 Answers1

0

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

Community
  • 1
  • 1
Raymond A
  • 763
  • 1
  • 12
  • 29