Commit bb8fc43
committed
feature symfony#59157 [HttpKernel] [MapQueryString] added key argument to MapQueryString attribute (feymo)
This PR was squashed before being merged into the 7.3 branch.
Discussion
----------
[HttpKernel] [MapQueryString] added key argument to MapQueryString attribute
| Q | A
| ------------- | ---
| Branch? | 7.3
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues | N/A
| License | MIT
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.
Commits
-------
ac1f54c [HttpKernel] [MapQueryString] added key argument to MapQueryString attributeFile tree
4 files changed
+28
-1
lines changed- src/Symfony/Component/HttpKernel
- Attribute
- Controller/ArgumentResolver
- Tests/Controller/ArgumentResolver
4 files changed
+28
-1
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
874 | 874 | | |
875 | 875 | | |
876 | 876 | | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
877 | 898 | | |
878 | 899 | | |
879 | 900 | | |
| |||
0 commit comments