Back to course

Route Parameters

Symfony 0 to Hero: The Complete 2026 Guide

Dynamic Routes

You can pass data through the URL:

php #[Route('/blog/{slug}', name: 'blog_show')] public function show(string $slug): Response { // $slug will be the value from the URL }

You can also add requirements using regular expressions directly in the attribute.