Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2194607

Browse files
committed
Add a pointer to webfactory/exceptions-bundle which helps with development of custom error pages.
1 parent642e776 commit2194607

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)

[8]ページ先頭

©2009-2025 Movatter.jp