Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions controller/value_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,22 @@ Symfony ships with the following value resolvers in the
You can restrict how the input can be formatted with the
:class:`Symfony\\Component\\HttpKernel\\Attribute\\MapDateTime` attribute.

.. tip::

The ``DateTimeInterface`` object is generated with the :doc:`Clock component </components/clock>`,
which means you can have full control over the date and time values the controller receives when
testing your application. This can be achieved by using the
:class:`Symfony\\Component\\Clock\\MockClock` implementation in your test environment.

.. versionadded:: 6.1

The ``DateTimeValueResolver`` was introduced in Symfony 6.1.

.. versionadded:: 6.3

The use of the :doc:`Clock component </components/clock>` to generate the
``DateTimeInterface`` object was introduced in Symfony 6.3.

:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestValueResolver`
Injects the current ``Request`` if type-hinted with ``Request`` or a class
extending ``Request``.
Expand Down