Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e7c950

Browse files
committed
1 parent 449dda8 commit 0e7c950

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

controller/value_resolver.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,23 @@ to your resolver and pass your custom name as its first argument::
475475
// ...
476476
}
477477

478+
You can then pass this name as ``ValueResolver``'s first argument to pin your resolver::
479+
480+
// src/Controller/BookingController.php
481+
namespace App\Controller;
482+
483+
use App\Reservation\BookingId;
484+
use Symfony\Component\HttpFoundation\Response;
485+
use Symfony\Component\HttpKernel\Attribute\ValueResolver;
486+
487+
class BookingController
488+
{
489+
public function index(#[ValueResolver('booking_id')] BookingId $id): Response
490+
{
491+
// ... do something with $id
492+
}
493+
}
494+
478495
.. versionadded:: 6.3
479496

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

0 commit comments

Comments
 (0)