Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Different routes resulting in Route Not Found exception due to the same action name in different controllers #318

Closed
jamhall opened this Issue Oct 18, 2012 · 4 comments

Comments

Projects
None yet
2 participants

jamhall commented Oct 18, 2012

I have two controllers,

SoftwareController.php:

    /**
     * @Get("/software/{ids}", defaults = {"_format" = "json"})
     * @View()
     */
    public function viewAction(Request $request, $ids)
   { 

InstituteController.php

   /**
     * @Get("/institutes/{ids}",  defaults={"_format" = "json"})
     * @View()
     */
    public function viewAction(Request $request, $ids)
    {

And when I navigate to /api/v1/institutes/1.json I get this error:

`No route found for "GET /api/v1/institutes/1.json"``

However, if I change the viewAction in InstituteController to something different, i.e viewInstituteAction. It works. Why is there a conflict if they're separate controllers?

Any further information you'd like to know please do not hesitate to let me know.

Thanks.

Owner

lsmith77 commented Oct 20, 2012

you need to manually set a @NamePrefix("my_prefix") .. guess we could consider automatically adding such a namespace prefix.

jamhall commented Oct 20, 2012

to the action or the controller?

Making it automatic would be very useful. +1

Thanks

Owner

lsmith77 commented Nov 7, 2012

closing .. please reopen if there are still questions.

@lsmith77 lsmith77 closed this Nov 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment