Skip to content

Commit 20dca7d

Browse files
committed
minor #19293 [HttpKernel] [Value Resolver] Added RequestPayloadValueResolver section (mattjanssen)
This PR was merged into the 6.3 branch. Discussion ---------- [HttpKernel] [Value Resolver] Added `RequestPayloadValueResolver` section Fix #19247 Commits ------- 93cec5f [Value Resolver] Added `RequestPayloadValueResolver` section
2 parents 553aa04 + 93cec5f commit 20dca7d

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

@@ -445,6 +447,8 @@ You can customize the validation groups used during the mapping thanks to the
445447
The :class:`Symfony\\Component\\HttpKernel\\Attribute\\MapQueryString` attribute
446448
was introduced in Symfony 6.3.
447449

450+
.. _controller-mapping-request-payload:
451+
448452
Mapping Request Payload
449453
~~~~~~~~~~~~~~~~~~~~~~~
450454

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy