File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -137,10 +137,13 @@ You can also store small messages that will only be available for the very
137
137
next request::
138
138
139
139
// store a message for the very next request (in a controller)
140
- $session->getFlashBag()->set ('notice', 'Congratulations, your action succeeded!');
140
+ $session->getFlashBag()->add ('notice', 'Congratulations, your action succeeded!');
141
141
142
- // display the message back in the next request (in a template)
143
- {{ app.session.flashBag.get('notice') }}
142
+ // display any messages back in the next request (in a template)
143
+
144
+ {% for flashMessage in app.session.flashbag.get('notice') %}
145
+ <div>{{ flashMessage }}</div>
146
+ {% endfor %}
144
147
145
148
This is useful when you need to set a success message before redirecting
146
149
the user to another page (which will then show the message). Please note that
You can’t perform that action at this time.
0 commit comments