@@ -115,6 +115,32 @@ Symfony ships with the following value resolvers in the
115115 Will set the default value of the argument if present and the argument
116116 is optional.
117117
118+ :class: `Symfony\\ Component\\ HttpKernel\\ Controller\\ ArgumentResolver\\ UidValueResolver `
119+ Attempts to convert any UID values from a route path parameter into UID objects.
120+ Leads to a 404 Not Found response if the value isn't a valid UID.
121+
122+ For example, the following will convert the token parameter into a ``UuidV4 `` object::
123+
124+ // src/Controller/DefaultController.php
125+ namespace App\Controller;
126+
127+ use Symfony\Component\HttpFoundation\Response;
128+ use Symfony\Component\Routing\Annotation\Route;
129+ use Symfony\Component\Uid\UuidV4;
130+
131+ class DefaultController
132+ {
133+ #[Route('/share/{token}')]
134+ public function share(UuidV4 $token): Response
135+ {
136+ // ...
137+ }
138+ }
139+
140+ .. versionadded :: 6.1
141+
142+ The ``UidValueResolver `` was introduced in Symfony 6.1.
143+
118144:class: `Symfony\\ Component\\ HttpKernel\\ Controller\\ ArgumentResolver\\ VariadicValueResolver `
119145 Verifies if the request data is an array and will add all of them to the
120146 argument list. When the action is called, the last (variadic) argument will
@@ -137,7 +163,7 @@ PSR-7 Objects Resolver:
137163 Injects a Symfony HttpFoundation ``Request `` object created from a PSR-7 object
138164 of type :class: `Psr\\ Http\\ Message\\ ServerRequestInterface `,
139165 :class: `Psr\\ Http\\ Message\\ RequestInterface ` or :class: `Psr\\ Http\\ Message\\ MessageInterface `.
140- It requires installing :doc: `the PSR-7 Bridge </components/psr7 >`_ component.
166+ It requires installing :doc: `the PSR-7 Bridge </components/psr7 >` component.
141167
142168Adding a Custom Value Resolver
143169------------------------------
0 commit comments