Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[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

Merged
merged 1 commit into from
Sep 1, 2017

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Aug 29, 2017

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.

@@ -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']);
Copy link
Member Author

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).

Copy link
Contributor

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.

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Aug 31, 2017
Copy link
Member

@chalasr chalasr left a 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.

@fabpot fabpot merged commit 00d959c into symfony:3.4 Sep 1, 2017
fabpot added a commit that referenced this pull request Sep 1, 2017
…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
@fabpot fabpot deleted the routes-prefix branch September 11, 2017 18:18
This was referenced Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.