@@ -3,9 +3,9 @@ How to customize Error Pages
3
3
4
4
When any exception is thrown in Symfony2, the exception is caught inside the
5
5
``Kernel `` class and eventually forwarded to a special controller,
6
- ``FrameworkBundle :Exception:show `` for handling. This controller, which lives
7
- inside the core ``FrameworkBundle ``, determines which error template to
8
- display and the status code that should be set for the given exception.
6
+ ``TwigBundle :Exception:show `` for handling. This controller, which lives
7
+ inside the core ``TwigBundle ``, determines which error template to display and
8
+ the status code that should be set for the given exception.
9
9
10
10
.. tip ::
11
11
@@ -14,14 +14,14 @@ display and the status code that should be set for the given exception.
14
14
which allows complete control over exception handling. For more
15
15
information, see :ref: `kernel-kernel.exception `.
16
16
17
- All of the error templates live inside ``FrameworkBundle ``. To override the
17
+ All of the error templates live inside ``TwigBundle ``. To override the
18
18
templates, we simply rely on the standard method for overriding templates that
19
19
live inside a bundle. For more information, see
20
20
:ref: `overriding-bundle-templates `.
21
21
22
22
For example, to override the default error template that's shown to the
23
23
end-user, create a new template located at
24
- ``app/Resources/FrameworkBundle /views/Exception/error.html.twig ``:
24
+ ``app/Resources/TwigBundle /views/Exception/error.html.twig ``:
25
25
26
26
.. code-block :: html+jinja
27
27
@@ -47,8 +47,8 @@ page for many of the most common response formats, including JSON
47
47
(``error.json.twig ``), XML, (``error.xml.twig ``), and even Javascript
48
48
(``error.js.twig ``), to name a few. To override any of these templates, just
49
49
create a new file with the same name in the
50
- ``app/Resources/FrameworkBundle /views/Exception `` directory. This is the
51
- standard way of overriding any template that lives inside a bundle.
50
+ ``app/Resources/TwigBundle /views/Exception `` directory. This is the standard
51
+ way of overriding any template that lives inside a bundle.
52
52
53
53
.. _cookbook-error-pages-by-status-code :
54
54
@@ -57,8 +57,8 @@ Customizing the 404 Page and other Error Pages
57
57
58
58
You can also customize specific error templates according to the HTTP status
59
59
code. For instance, create a
60
- ``app/Resources/FrameworkBundle /views/Exception/error404.html.twig `` template
61
- to display a special page for 404 (page not found) errors.
60
+ ``app/Resources/TwigBundle /views/Exception/error404.html.twig `` template to
61
+ display a special page for 404 (page not found) errors.
62
62
63
63
Symfony uses the following algorithm to determine which template to use:
64
64
@@ -74,11 +74,11 @@ Symfony uses the following algorithm to determine which template to use:
74
74
.. tip ::
75
75
76
76
To see the full list of default error templates, see the
77
- ``Resources/views/Exception `` directory of the ``FrameworkBundle ``. In a
78
- standard Symfony2 installation, the ``FrameworkBundle `` can be found at
79
- ``vendor/symfony/src/Symfony/Bundle/FrameworkBundle ``. Often, the easiest
80
- way to customize an error page is to copy it from the ``FrameworkBundle ``
81
- into ``app/Resources/FrameworkBundle /views/Exception `` and then modify it.
77
+ ``Resources/views/Exception `` directory of the ``TwigBundle ``. In a
78
+ standard Symfony2 installation, the ``TwigBundle `` can be found at
79
+ ``vendor/symfony/src/Symfony/Bundle/TwigBundle ``. Often, the easiest way
80
+ to customize an error page is to copy it from the ``TwigBundle `` into
81
+ ``app/Resources/TwigBundle /views/Exception `` and then modify it.
82
82
83
83
.. note ::
84
84
0 commit comments