Skip to content

Commit ed3c383

Browse files
committed
[symfony/twig-bundle] add flash messages to base.html.twig
1 parent 7d43cf1 commit ed3c383

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

symfony/twig-bundle/5.4/templates/base.html.twig

+12
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@
1414
{% endblock %}
1515
</head>
1616
<body>
17+
{% block flashes %}
18+
{% if app.request.hasPreviousSession %}
19+
{% for type, messages in app.flashes %}
20+
{% for message in messages %}
21+
<div class="alert alert-{{ type }}" role="alert">
22+
{{ message }}
23+
</div>
24+
{% endfor %}
25+
{% endfor %}
26+
{% endif %}
27+
{% endblock %}
28+
1729
{% block body %}{% endblock %}
1830
</body>
1931
</html>

0 commit comments

Comments
 (0)