From 8bc10c6d13829a73ea05eaa1c58246814a352fff Mon Sep 17 00:00:00 2001 From: Sergiu Popa Date: Tue, 31 Jan 2017 08:13:16 +0100 Subject: [PATCH] Add Twig to display all flashes --- components/http_foundation/sessions.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/http_foundation/sessions.rst b/components/http_foundation/sessions.rst index 60b639c8dd9..7a641b3d02e 100644 --- a/components/http_foundation/sessions.rst +++ b/components/http_foundation/sessions.rst @@ -333,3 +333,12 @@ Compact method to process display all flashes at once:: echo '
'.$message.'
'; } } + +Compact method to process display all flashes at once, in Twig:: + {% for label, flashes in app.session.flashbag.all %} + {% for flash in flashes %} +
+ {{ flash }} +
+ {% endfor %} + {% endfor %}