From 3a52f560625e0fc7a0f37c1e27b9dc80d2913705 Mon Sep 17 00:00:00 2001 From: Maarten de Keizer Date: Mon, 18 Apr 2022 16:54:14 +0200 Subject: [PATCH] Fix path/example content of error route files Removed `dev` part from file location, adjusted code example. --- controller/error_pages.rst | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/controller/error_pages.rst b/controller/error_pages.rst index a94294573a0..2eec5213956 100644 --- a/controller/error_pages.rst +++ b/controller/error_pages.rst @@ -155,32 +155,37 @@ automatically when installing ``symfony/framework-bundle``): .. code-block:: yaml - # config/routes/dev/framework.yaml - _errors: - resource: '@FrameworkBundle/Resources/config/routing/errors.xml' - prefix: /_error + # config/routes/framework.yaml + when@dev: + _errors: + resource: '@FrameworkBundle/Resources/config/routing/errors.xml' + prefix: /_error .. code-block:: xml - + - + + + .. code-block:: php - // config/routes/dev/framework.php + // config/routes/framework.php use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; return function (RoutingConfigurator $routes) { - $routes->import('@FrameworkBundle/Resources/config/routing/errors.xml') - ->prefix('/_error') - ; + if ('dev' === $container->env()) { + $routes->import('@FrameworkBundle/Resources/config/routing/errors.xml') + ->prefix('/_error') + ; + } }; With this route added, you can use URLs like these to preview the *error* page