Skip to content

Commit a76fee3

Browse files
committed
Merge branch '6.3' into 6.4
* 6.3: [Value Resolver] Added `RequestPayloadValueResolver` section
2 parents fa3173c + 20dca7d commit a76fee3

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

controller.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,8 @@ attribute, arguments of your controller's action can be automatically fulfilled:
388388
The :class:`Symfony\\Component\\HttpKernel\\Attribute\\MapQueryParameter` attribute
389389
was introduced in Symfony 6.3.
390390

391+
.. _controller-mapping-query-string:
392+
391393
Mapping The Whole Query String
392394
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
393395

@@ -458,6 +460,8 @@ The default status code returned if the validation fails is 404.
458460

459461
The ``validationFailedStatusCode`` parameter was introduced in Symfony 6.4.
460462

463+
.. _controller-mapping-request-payload:
464+
461465
Mapping Request Payload
462466
~~~~~~~~~~~~~~~~~~~~~~~
463467

controller/value_resolver.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,19 @@ Symfony ships with the following value resolvers in the
7979

8080
The ``BackedEnumValueResolver`` and ``EnumRequirement`` were introduced in Symfony 6.1.
8181

82+
83+
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestPayloadValueResolver`
84+
Maps the request payload or the query string into the type-hinted object.
85+
86+
Because this is a :ref:`targeted value resolver <value-resolver-targeted>`,
87+
you'll have to use either the :ref:`MapRequestPayload <controller-mapping-request-payload>`
88+
or the :ref:`MapQueryString <controller-mapping-query-string>` attribute
89+
in order to use this resolver.
90+
91+
.. versionadded:: 6.3
92+
93+
The ``RequestPayloadValueResolver`` was introduced in Symfony 6.3.
94+
8295
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestAttributeValueResolver`
8396
Attempts to find a request attribute that matches the name of the argument.
8497

@@ -430,6 +443,8 @@ command to see which argument resolvers are present and in which order they run:
430443
You can also configure the name passed to the ``ValueResolver`` attribute to target
431444
your resolver. Otherwise it will default to the service's id.
432445

446+
.. _value-resolver-targeted:
447+
433448
``controller.targeted_value_resolver``
434449
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
435450

0 commit comments

Comments
 (0)