@@ -154,7 +154,8 @@ automatically when installing ``symfony/framework-bundle``):
154154 # config/routes/framework.yaml
155155 when@dev :
156156 _errors :
157- resource : ' @FrameworkBundle/Resources/config/routing/errors.xml'
157+ resource : ' @FrameworkBundle/Resources/config/routing/errors.php'
158+ type : php
158159 prefix : /_error
159160
160161 .. code-block :: xml
@@ -167,7 +168,7 @@ automatically when installing ``symfony/framework-bundle``):
167168 https://symfony.com/schema/routing/routing-1.0.xsd" >
168169
169170 <when env =" dev" >
170- <import resource =" @FrameworkBundle/Resources/config/routing/errors.xml " prefix =" /_error" />
171+ <import resource =" @FrameworkBundle/Resources/config/routing/errors.php " type = " php " prefix =" /_error" />
171172 </when >
172173 </routes >
173174
@@ -178,7 +179,7 @@ automatically when installing ``symfony/framework-bundle``):
178179
179180 return function (RoutingConfigurator $routes): void {
180181 if ('dev' === $routes->env()) {
181- $routes->import('@FrameworkBundle/Resources/config/routing/errors.xml ')
182+ $routes->import('@FrameworkBundle/Resources/config/routing/errors.php', 'php ')
182183 ->prefix('/_error')
183184 ;
184185 }
@@ -191,6 +192,11 @@ need to replace ``http://localhost/`` by the host used in your local setup):
191192* ``http://localhost/_error/{statusCode} `` for HTML
192193* ``http://localhost/_error/{statusCode}.{format} `` for any other format
193194
195+ .. versionadded :: 7.3
196+
197+ The ``errors.php `` file was introduced in Symfony 7.3.
198+ Previously, you had to import ``errors.xml ``
199+
194200.. _overriding-non-html-error-output :
195201
196202Overriding Error output for non-HTML formats
0 commit comments