Skip to content

Commit 4c900bb

Browse files
committed
minor #571 Simplified the flash messages (javiereguiluz)
This PR was squashed before being merged into the master branch (closes #571). Discussion ---------- Simplified the flash messages As explained in https://symfony.com/blog/new-in-symfony-3-3-improved-flash-messages Commits ------- 5c5a9ac Simplified the flash messages
2 parents 82bfa9e + 5c5a9ac commit 4c900bb

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

app/Resources/views/default/_flash_messages.html.twig

+12-14
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,17 @@
77
'_flash_messages.html.twig' instead of 'flash_messages.html.twig'
88
#}
99

10-
{% if app.session.started and app.session.flashBag.peekAll is not empty %}
11-
<div class="messages">
12-
{% for type, messages in app.session.flashBag.all %}
13-
{% for message in messages %}
14-
{# Bootstrap alert, see http://getbootstrap.com/components/#alerts #}
15-
<div class="alert alert-dismissible alert-{{ type }}" role="alert">
16-
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
17-
<span aria-hidden="true">&times;</span>
18-
</button>
10+
<div class="messages">
11+
{% for type, messages in app.flashes %}
12+
{% for message in messages %}
13+
{# Bootstrap alert, see http://getbootstrap.com/components/#alerts #}
14+
<div class="alert alert-dismissible alert-{{ type }}" role="alert">
15+
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
16+
<span aria-hidden="true">&times;</span>
17+
</button>
1918

20-
{{ message|trans }}
21-
</div>
22-
{% endfor %}
19+
{{ message|trans }}
20+
</div>
2321
{% endfor %}
24-
</div>
25-
{% endif %}
22+
{% endfor %}
23+
</div>

0 commit comments

Comments
 (0)