-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] Allow query-specific parameters in UrlGenerator
using _query
#60508
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
_query
_query
_query
UrlGenerator
using _query
If someone is using |
I agree, unless it is considered that names starting with an underscore are reserved for Symfony, and not covered by the BC promise; I don't know about this, but there's a precedent here with |
The difference is that A better example might be to look at how we handled |
@stof Good point. The BC break concern was raised by @Koc back then, but was dismissed by @Tobion:
I'll leave it up to you to decide whether introducing another one in a minor release is still acceptable in 2025; maybe this is something that could be documented in Our Backward Compatibility Promise? |
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.
Works for me, just one comment
bcc1a01
to
34568da
Compare
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.
2 minor changes and GTM
Thank you @BenMorel. |
This PR adds support for a special
_query
key in$parameters
ofUrlGenerator::generate()
, that is used exclusively to generate query parameters. This is useful when query parameters may conflict with route parameters of the same name.Concrete use case:
My application has a route that looks like:
And I want to generate this URL:
With this PR, I can now call: