Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.2k
[Routing] Add Attribute code examples for alias in#[Route]
attribute#20638
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
5ccc81e
tod65f27b
Compare@stof for review I've fixed issues we talk about in private. But, as we discussed, we need to make this Route Alias part of the documentation a bit clearer on lower branches. This PR documents the new way to create route aliases using Attributes (which differs from the way to do in YAML, XML and PHP, if I've understood correctly). |
Uh oh!
There was an error while loading.Please reload this page.
… route names (welcoMattic)This PR was squashed before being merged into the 6.4 branch.Discussion----------[Routing] Clarify route aliases examples with explicit route namesRefers to#20638 (comment)Actual examples for route aliasing are not crystal clear.Now, examples in YAML, XML and PHP provide- An original route, declared with an explicit name- An alias to this route, with an explicit nameThis change will allow to provide another clear example for route aliasing using Attribute in#20638cc `@stof` `@damienfern`Commits-------a28b614 [Routing] Clarify route aliases examples with explicit route names
d65f27b
to848f249
ComparewelcoMattic commentedMay 20, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@symfony/docs I reworked this PR to only add PHP Attribute code blocks about Route Aliasing and Deprecated Route Aliases. Your review is welcome 🙏 Status: Needs review |
#[Route]
attributeUh oh!
There was an error while loading.Please reload this page.
So that you can use your own route name for URL generation, | ||
while actually using a route defined by a third-party bundle as the target of that URL generation, | ||
as the 2 definitions are not required to be in the same config file (or even in the same format). |
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.
@OskarStark@stof I've added this side note, is it ok for you?
b429aae
to22cd58e
Compare0b3db8e
intosymfony:7.3Uh oh!
There was an error while loading.Please reload this page.
Merged! Thanks Mathieu. I added the |
Fixes#20600
This one adds code examples to alias route in
#[Route]
attribute. It also add example usingDeprecatedAlias
.I've also added a note to precise
new_route_name
andoriginal_route_name
meaning, to avoid misunderstanding.cc@damienfern