File tree 1 file changed +19
-1
lines changed
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,25 @@ will be passed two parameters:
217
217
Instead of creating a new exception controller from scratch you can, of course,
218
218
also extend the default :class: `Symfony\\ Bundle\\ TwigBundle\\ Controller\\ ExceptionController `.
219
219
In that case, you might want to override one or both of the ``showAction() `` and
220
- ``findTemplate() `` methods. The latter one locates the template to be used.
220
+ ``findTemplate() `` methods. The latter one locates the template to be used.
221
+
222
+ .. note ::
223
+
224
+ In case of extending the :class: `Symfony\\ Bundle\\ TwigBundle\\ Controller\\ ExceptionController `
225
+ you may configure a service to pass the Twig environment and the ``debug `` flag to the constructor.
226
+
227
+ .. configuration-block ::
228
+
229
+ .. code-block :: yaml
230
+
231
+ # app/config/config.yml
232
+ services :
233
+ app.extension_controller :
234
+ class : AppBundle\CustomExceptionController
235
+ arguments : [ "@twig", "%kernel.debug%" ]
236
+
237
+ twig :
238
+ exception_controller : app.extension_controller:showAction
221
239
222
240
.. _use-kernel-exception-event :
223
241
You can’t perform that action at this time.
0 commit comments