Skip to content

[Routing] Add support for aliasing routes #38389

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

Closed
wants to merge 3 commits into from
Closed

[Routing] Add support for aliasing routes #38389

wants to merge 3 commits into from

Conversation

Lctrs
Copy link
Contributor

@Lctrs Lctrs commented Oct 2, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #6088
License MIT
Doc PR None yet

@Lctrs
Copy link
Contributor Author

Lctrs commented Oct 2, 2020

Will update changelog later. Created it first to gather reviews.

throw new InvalidArgumentException(sprintf('An alias can not reference itself, got a circular reference on "%s".', $alias));
}

unset($this->routes[$alias], $this->priorities[$alias]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment to explain why you unset these keys in these array?

@stof
Copy link
Member

stof commented Oct 2, 2020

based on the discussion happening in #6088 (comment) and following comments, we should be able to mark aliases as deprecated, so that the UrlGenerator triggers a deprecation when trying to generate the URL for such alias (pointing to the new name).
This would have an impact on the way the feature is implemented (currently, you convert aliases to actual routes before the matcher sees them)

Lctrs and others added 2 commits October 3, 2020 15:42
Co-authored-by: GoT <PierreRambaud@users.noreply.github.com>
Co-authored-by: GoT <PierreRambaud@users.noreply.github.com>
@fabpot fabpot closed this Oct 7, 2020
@fabpot
Copy link
Member

fabpot commented Oct 7, 2020

We've just moved away from master as the main branch to use 5.x instead. Unfortunately, I cannot reopen the PR and change the target branch to 5.x. Can you open a new PR referencing this one to not loose the discussion? Thank you for your understanding and for your help.

@Lctrs
Copy link
Contributor Author

Lctrs commented Oct 7, 2020

#38464

@nicolas-grekas nicolas-grekas modified the milestones: 5.x, 5.2 Oct 14, 2020
nicolas-grekas added a commit that referenced this pull request Nov 4, 2021
This PR was merged into the 5.4 branch.

Discussion
----------

[Routing] Add support for aliasing routes

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | Fix #6088 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | None yet

Continuation of #38389

Commits
-------

43575a1 [Routing] Add support for aliasing routes
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.

[Routing] Add support for alias routes
6 participants