From b3709ad0137e16c4a10a82a2f3d57e28c750a060 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 27 Oct 2022 00:26:30 +0200 Subject: [PATCH] Fix syntax for loading PSR-4 routes from PHP files --- routing/custom_route_loader.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/routing/custom_route_loader.rst b/routing/custom_route_loader.rst index 5aa90a8712d..2b506aba40e 100644 --- a/routing/custom_route_loader.rst +++ b/routing/custom_route_loader.rst @@ -65,7 +65,7 @@ Symfony provides several route loaders for the most common needs: - + @@ -92,7 +92,10 @@ Symfony provides several route loaders for the most common needs: // loads routes from the PHP attributes (#[Route(...)]) // of the controllers found in the given PSR-4 namespace root - $routes->import('../src/Controller/', 'attribute@App\Controller'); + $routes->import( + ['path' => '../src/Controller/', 'namespace' => 'App\Controller'], + 'attribute', + ); // loads routes from the PHP attributes (#[Route(...)]) // of the controllers found in that directory