From 9c910d74bfe8e2bc6850ded5ad94cdb28ffd4a5d Mon Sep 17 00:00:00 2001 From: Tim Goudriaan Date: Thu, 3 Mar 2022 11:58:05 +0100 Subject: [PATCH] Add information about DateTimeValueResolver --- controller/argument_value_resolver.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/controller/argument_value_resolver.rst b/controller/argument_value_resolver.rst index 346a96ffbeb..02d0a5b5971 100644 --- a/controller/argument_value_resolver.rst +++ b/controller/argument_value_resolver.rst @@ -59,6 +59,15 @@ Symfony ships with the following value resolvers in the :class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestAttributeValueResolver` Attempts to find a request attribute that matches the name of the argument. +:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\DateTimeValueResolver` + Attempts to find a request attribute that matches the name of the argument + and injects a ``DateTimeInterface`` object if type-hinted with a class + extending ``DateTimeInterface``. + + By default any input that can be parsed as a date string by PHP is accepted. + You can restrict how the input can be formatted with the + :class:`Symfony\\Component\\HttpKernel\\Attribute\\MapDateTime` attribute. + :class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestValueResolver` Injects the current ``Request`` if type-hinted with ``Request`` or a class extending ``Request``.