-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] [MapQueryString] added key argument to MapQueryString attribute #59157
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
[HttpKernel] [MapQueryString] added key argument to MapQueryString attribute #59157
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
7fbdfca
to
ac1f54c
Compare
Thank you @feymo. |
…n (feymo) This PR was merged into the 7.3 branch. Discussion ---------- [HttpKernel] [MapQueryString] Add docs for new key option Will fix #20463 Add documentation for the new `key` option added to `MapQueryString` attribute added in symfony/symfony#59157 Commits ------- 2fdd0db docs(controller): add docs for key option in MapQueryString
When using
[#MapQueryString]
, the default resolver uses the$request->query-all()
function but there's currently no way to pass a specific key to this function if needed.This PR add a
$key
argument to the#[MapQueryString]
attribute that will allow to pass a specific key if needed to the default resolver.Example :
Given the following query :
https://example.org?search[term]=foo&search[category]=bar
, using current#[MapQueryString]
implementation will resolve an object with only$search
property.Change proposed in this PR allows to pass a
key
argument like#[MapQueryString(key: search)]
. Doing so, the object will be resolved with$term
and$category
properties.