Skip to content

Commit

Permalink
Add a pointer to webfactory/exceptions-bundle which helps with develo…
Browse files Browse the repository at this point in the history
…pment of custom error pages.
  • Loading branch information
mpdude committed Feb 13, 2014
1 parent 642e776 commit 2194607
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cookbook/controller/error_pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,24 @@ Symfony uses the following algorithm to determine which template to use:
customized in the same way by creating templates such as
``exception.html.twig`` for the standard HTML exception page or
``exception.json.twig`` for the JSON exception page.

Testing Error Pages during development
--------------------------------------

The default exception controller,
``Symfony\Bundle\TwigBundle\Controller\ExceptionController``, which is
part of the TwigBundle will show
*exception* pages when you're in ``kernel.debug`` mode and *error*
pages otherwise. Thus, your end users will typically see the *error*
pages.

But setting ``kernel.debug`` to ``false`` during development to write
or test your custom error pages is impractical as it stops Symfony2 from
recompiling the Twig templates, among other things.

To help you with that, `webfactory/exceptions-bundle`_ contains a
simple test controller that you can use to trigger custom exceptions. At
the same time, it will make the `ExceptionController` display the
corresponding *error* pages also in ``kernel.debug`` mode.

.. _`webfactory/exceptions-bundle`: https://github.com/webfactory/exceptions-bundle

0 comments on commit 2194607

Please # to comment.