Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91de5cd

Browse files
committed
minor #7557 Fixed the way flash messages are retrieved in the template (javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- Fixed the way flash messages are retrieved in the template In #7432 I changed the code of the templates to get the flash messages. I don't know why I did that ... because it's completely wrong 😵 In #7555 @lerox pointed this issue and I can confirm it: ![symfony_error](https://cloud.githubusercontent.com/assets/73419/23469257/6e423134-fea3-11e6-8d08-e56b01839404.png) So, let's revert it. Commits ------- 8ac43ca Fixed the way flash messages are retrieved in the template
2 parents 5504bd6 + 8ac43ca commit 91de5cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

controller.rst

Lines changed: 2 additions & 2 deletions
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)