Skip to content

Commit 7348d05

Browse files
committed
Add exception as HTML comment to beginning and end of exception_full.html.twig
Every now and then you are confronted with an exception in Symfony's debug mode. Sometimes, you will see this in your browser console or terminal. To make it easier to easily see what's going on, this change adds a HTML comment on 2 locations: - between the `<html>` and `<head>` tag; - between the `</body>` and `</html>` tag. This way, you don't have to scan the very verbose HTML that Symfony generates. You can quickly glance at the end or the beginning.
1 parent 519ba3c commit 7348d05

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/Symfony/Bundle/TwigBundle/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
4.3.0
5+
-----
6+
7+
* added HTML comment to beginning and end of `exception_full.html.twig`
8+
49
4.2.0
510
-----
611

src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@
137137
{{ exception.message }} ({{ status_code }} {{ status_text }})
138138
{% endblock %}
139139

140+
{% block before_head %}
141+
<!-- {{ exception.message }} ({{ status_code }} {{ status_text }}) -->
142+
{% endblock %}
143+
144+
{% block after_body %}
145+
<!-- {{ exception.message }} ({{ status_code }} {{ status_text }}) -->
146+
{% endblock %}
147+
140148
{% block body %}
141149
{% include '@Twig/Exception/exception.html.twig' %}
142150
{% endblock %}

src/Symfony/Bundle/TwigBundle/Resources/views/layout.html.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!DOCTYPE html>
22
<html>
3+
{% block before_head %}{% endblock %}
34
<head>
45
<meta charset="{{ _charset }}" />
56
<meta name="robots" content="noindex,nofollow" />
@@ -33,4 +34,5 @@
3334
{% block body %}{% endblock %}
3435
{{ include('@Twig/base_js.html.twig') }}
3536
</body>
37+
{% block after_body %}{% endblock %}
3638
</html>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy