Skip to content

Commit 1509f6f

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: [Value Resolver] Added `RequestPayloadValueResolver` section
2 parents 1bb9578 + a76fee3 commit 1509f6f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

controller.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ attribute, arguments of your controller's action can be automatically fulfilled:
379379
// ...
380380
}
381381

382+
.. _controller-mapping-query-string:
383+
382384
Mapping The Whole Query String
383385
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
384386

@@ -440,6 +442,8 @@ HTTP status to return if the validation fails::
440442

441443
The default status code returned if the validation fails is 404.
442444

445+
.. _controller-mapping-request-payload:
446+
443447
Mapping Request Payload
444448
~~~~~~~~~~~~~~~~~~~~~~~
445449

controller/value_resolver.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ Symfony ships with the following value resolvers in the
7575
The example above allows requesting only ``/cards/D`` and ``/cards/S``
7676
URLs and leads to 404 Not Found response in two other cases.
7777

78+
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestPayloadValueResolver`
79+
Maps the request payload or the query string into the type-hinted object.
80+
81+
Because this is a :ref:`targeted value resolver <value-resolver-targeted>`,
82+
you'll have to use either the :ref:`MapRequestPayload <controller-mapping-request-payload>`
83+
or the :ref:`MapQueryString <controller-mapping-query-string>` attribute
84+
in order to use this resolver.
85+
7886
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestAttributeValueResolver`
7987
Attempts to find a request attribute that matches the name of the argument.
8088

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

404+
.. _value-resolver-targeted:
405+
396406
``controller.targeted_value_resolver``
397407
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
398408

0 commit comments

Comments
 (0)