Skip to content

Commit 9c910d7

Browse files
committed
Add information about DateTimeValueResolver
1 parent 3919a5b commit 9c910d7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

controller/argument_value_resolver.rst

+9
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ Symfony ships with the following value resolvers in the
5959
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestAttributeValueResolver`
6060
Attempts to find a request attribute that matches the name of the argument.
6161

62+
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\DateTimeValueResolver`
63+
Attempts to find a request attribute that matches the name of the argument
64+
and injects a ``DateTimeInterface`` object if type-hinted with a class
65+
extending ``DateTimeInterface``.
66+
67+
By default any input that can be parsed as a date string by PHP is accepted.
68+
You can restrict how the input can be formatted with the
69+
:class:`Symfony\\Component\\HttpKernel\\Attribute\\MapDateTime` attribute.
70+
6271
:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestValueResolver`
6372
Injects the current ``Request`` if type-hinted with ``Request`` or a class
6473
extending ``Request``.

0 commit comments

Comments
 (0)