Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2194607

Browse files
committed
Add a pointer to webfactory/exceptions-bundle which helps with development of custom error pages.
1 parent 642e776 commit 2194607

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cookbook/controller/error_pages.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,24 @@ Symfony uses the following algorithm to determine which template to use:
110110
customized in the same way by creating templates such as
111111
``exception.html.twig`` for the standard HTML exception page or
112112
``exception.json.twig`` for the JSON exception page.
113+
114+
Testing Error Pages during development
115+
--------------------------------------
116+
117+
The default exception controller,
118+
``Symfony\Bundle\TwigBundle\Controller\ExceptionController``, which is
119+
part of the TwigBundle will show
120+
*exception* pages when you're in ``kernel.debug`` mode and *error*
121+
pages otherwise. Thus, your end users will typically see the *error*
122+
pages.
123+
124+
But setting ``kernel.debug`` to ``false`` during development to write
125+
or test your custom error pages is impractical as it stops Symfony2 from
126+
recompiling the Twig templates, among other things.
127+
128+
To help you with that, `webfactory/exceptions-bundle`_ contains a
129+
simple test controller that you can use to trigger custom exceptions. At
130+
the same time, it will make the `ExceptionController` display the
131+
corresponding *error* pages also in ``kernel.debug`` mode.
132+
133+
.. _`webfactory/exceptions-bundle`: https://github.com/webfactory/exceptions-bundle

0 commit comments

Comments
 (0)