From 8ac43caf18f6064e04a10c71ec44686f83b248da Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 1 Mar 2017 17:21:26 +0100 Subject: [PATCH] Fixed the way flash messages are retrieved in the template --- controller.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller.rst b/controller.rst index 22b9b22a7f9..f3fc7ce7b69 100644 --- a/controller.rst +++ b/controller.rst @@ -427,14 +427,14 @@ read any flash messages from the session: {# app/Resources/views/base.html.twig #} {# you can read and display just one flash message type... #} - {% for flash_message in app.session.flash('notice') %} + {% for flash_message in app.session.flashBag.get('notice') %}
{{ flash_message }}
{% endfor %} {# ...or you can read and display every flash message available #} - {% for type, flash_messages in app.session.flashes %} + {% for type, flash_messages in app.session.flashBag.all %} {% for flash_message in flash_messages %}
{{ flash_message }}