@@ -154,7 +154,8 @@ automatically when installing ``symfony/framework-bundle``):
154
154
# config/routes/framework.yaml
155
155
when@dev :
156
156
_errors :
157
- resource : ' @FrameworkBundle/Resources/config/routing/errors.xml'
157
+ resource : ' @FrameworkBundle/Resources/config/routing/errors.php'
158
+ type : php
158
159
prefix : /_error
159
160
160
161
.. code-block :: xml
@@ -167,7 +168,7 @@ automatically when installing ``symfony/framework-bundle``):
167
168
https://symfony.com/schema/routing/routing-1.0.xsd" >
168
169
169
170
<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" />
171
172
</when >
172
173
</routes >
173
174
@@ -178,7 +179,7 @@ automatically when installing ``symfony/framework-bundle``):
178
179
179
180
return function (RoutingConfigurator $routes): void {
180
181
if ('dev' === $routes->env()) {
181
- $routes->import('@FrameworkBundle/Resources/config/routing/errors.xml ')
182
+ $routes->import('@FrameworkBundle/Resources/config/routing/errors.php', 'php ')
182
183
->prefix('/_error')
183
184
;
184
185
}
@@ -191,6 +192,11 @@ need to replace ``http://localhost/`` by the host used in your local setup):
191
192
* ``http://localhost/_error/{statusCode} `` for HTML
192
193
* ``http://localhost/_error/{statusCode}.{format} `` for any other format
193
194
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
+
194
200
.. _overriding-non-html-error-output :
195
201
196
202
Overriding Error output for non-HTML formats
0 commit comments