8000 minor #16562 [Serializer] Add information about DateTimeValueResolver… · symfony/symfony-docs@eeadb9a · GitHub
[go: up one dir, main page]

Skip to content

Commit eeadb9a

Browse files
committed
minor #16562 [Serializer] Add information about DateTimeValueResolver (codedmonkey)
This PR was merged into the 6.1 branch. Discussion ---------- [Serializer] Add information about DateTimeValueResolver Adds documentation for symfony/symfony#45589. I think it would be a good idea to explain how to 8000 use the `MapDateTime` attribute, but I opted to keep it brief. Commits ------- 9c910d7 Add information about DateTimeValueResolver
2 parents 2c03f2d + 9c910d7 commit eeadb9a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

controller/argument_value_resolver.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ Symfony ships with the following value resolvers in the
8585
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestAttributeValueResolver`
8686
Attempts to find a request attribute that matches the name of the argument.
8787

88+
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\DateTimeValueResolver`
89+
Attempts to find a request attribute that matches the name of the argument
90+
and injects a ``DateTimeInterface`` object if type-hinted with a class
91+
extending ``DateTimeInterface``.
92+
93+
By default any input that can be parsed as a date string by PHP is accepted.
94+
You can restrict how the input can be formatted with the
95+
:class:`Symfony\\Component\\HttpKernel\\Attribute\\MapDateTime` attribute.
96+
8897
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestValueResolver`
8998
Injects the current ``Request`` if type-hinted with ``Request`` or a class
9099
extending ``Request``.

0 commit comments

Comments
 (0)
0