Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
jamhall opened this Issue · 4 comments

2 participants

Jamie Hall Lukas Kahwe Smith
Jamie Hall

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.

Lukas Kahwe Smith
Owner

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

Jamie Hall

to the action or the controller?

Making it automatic would be very useful. +1

Thanks

Lukas Kahwe Smith
Owner

closing .. please reopen if there are still questions.

Lukas Kahwe Smith lsmith77 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.