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 }}