-
-
Notifications
You must be signed in to change notification settings - Fork 5.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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 7.3
Are you sure you want to change the base?
Conversation
5ccc81e
to
d65f27b
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). |
… route names (welcoMattic) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Routing] Clarify route aliases examples with explicit route names Refers 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 name This change will allow to provide another clear example for route aliasing using Attribute in #20638 cc `@stof` `@damienfern` Commits ------- a28b614 [Routing] Clarify route aliases examples with explicit route names
d65f27b
to
848f249
Compare
@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]
attribute
|
||
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?
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