-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] Add the possibility to define a prefix for all routes of a controller #24031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -240,7 +241,7 @@ public function testInvokableClassWithMethodRouteLoad() | ||
|
||
$this->assertNull($route, '->load ignores class route'); | ||
|
||
$route = $routeCollection->get($methodRouteData['name']); | ||
$route = $routeCollection->get($classRouteData['name'].$methodRouteData['name']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, that's a BC break, but I don't think this matters much as someone defining a class with an __invoke
method would probably not define a name on the class @Route
annotation (I don't see the point).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right, because it would have to map to the __invoke
method, even if @Route()
was used for the service definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relates to #19612 somehow.
…ll routes of a controller (fabpot) This PR was merged into the 3.4 branch. Discussion ---------- [Routing] Add the possibility to define a prefix for all routes of a controller | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | sensiolabs/SensioFrameworkExtraBundle#283 | License | MIT | Doc PR | not yet This PR adds the possibility to define a name on a `@Route` annotation set on a controller class. The name is then used as a prefix for all routes defined in the controller. Commits ------- 00d959c [Routing] added the possibility to define a prefix for all routes of a controller
This PR adds the possibility to define a name on a
@Route
annotation set on a controller class. The name is then used as a prefix for all routes defined in the controller.