Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fa8e76b

Browse filesBrowse files
committed
1 parent b721ee4 commit fa8e76b
Copy full SHA for fa8e76b

File tree

1 file changed

+17
-0
lines changed
Filter options

1 file changed

+17
-0
lines changed

‎controller/value_resolver.rst

Copy file name to clipboardExpand all lines: controller/value_resolver.rst
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,23 @@ to your resolver and pass your custom name as its first argument::
464464
// ...
465465
}
466466

467+
You can then pass this name as ``ValueResolver``'s first argument to pin your resolver::
468+
469+
// src/Controller/BookingController.php
470+
namespace App\Controller;
471+
472+
use App\Reservation\BookingId;
473+
use Symfony\Component\HttpFoundation\Response;
474+
use Symfony\Component\HttpKernel\Attribute\ValueResolver;
475+
476+
class BookingController
477+
{
478+
public function index(#[ValueResolver('booking_id')] BookingId $id): Response
479+
{
480+
// ... do something with $id
481+
}
482+
}
483+
467484
.. versionadded:: 6.3
468485

469486
The ``controller.targeted_value_resolver`` tag and ``AsTargetedValueResolver``

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.