Back to course

ParamConverter (Entity Value Resolver)

Symfony 0 to Hero: The Complete 2026 Guide

Automatic Entity Fetching

Symfony can automatically fetch an entity if the route parameter matches an ID:

php #[Route('/product/{id}', name: 'product_show')] public function show(Product $product): Response { // Symfony already fetched the product for you! }