Skip to content

Commit 8ac43ca

Browse files
committed
Fixed the way flash messages are retrieved in the template
1 parent 185e886 commit 8ac43ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

controller.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,14 @@ read any flash messages from the session:
427427
{# app/Resources/views/base.html.twig #}
428428

429429
{# you can read and display just one flash message type... #}
430-
{% for flash_message in app.session.flash('notice') %}
430+
{% for flash_message in app.session.flashBag.get('notice') %}
431431
<div class="flash-notice">
432432
{{ flash_message }}
433433
</div>
434434
{% endfor %}
435435

436436
{# ...or you can read and display every flash message available #}
437-
{% for type, flash_messages in app.session.flashes %}
437+
{% for type, flash_messages in app.session.flashBag.all %}
438438
{% for flash_message in flash_messages %}
439439
<div class="flash-{{ type }}">
440440
{{ flash_message }}

0 commit comments

Comments
 (0)