File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,15 @@ You can also store small messages that will only be available for the very
137137
next request::
138138

139139
// store a message for the very next request (in a controller)
140-
$session->setFlash('notice', 'Congratulations, your action succeeded!');
140+
$session->getFlashBag()->set('notice', 'Congratulations, your action succeeded!');
141141

142142
// display the message back in the next request (in a template)
143-
{{ app.session.flash('notice') }}
143+
{{ app.session.flashBag.get('notice') }}
144144

145145
This is useful when you need to set a success message before redirecting
146-
the user to another page (which will then show the message).
146+
the user to another page (which will then show the message). Please note that
147+
when you use has() instead of get(), the flash message will not be cleared and
148+
thus remain available during following requests.
147149

148150
Securing Resources
149151
------------------

0 commit comments

Comments
 (0)