Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed PHP User Authentication!
You have completed PHP User Authentication!
Preview
As a little bonus, let’s add some nice messages in the session flashes to give feedback to the user.
Styles for New Function display_success()
Name of bag: success
Name of class: alert-success
$messages = $session->getFlashBag()->get('success');
$response = '<div class="alert alert-success alert-dismissable">';
Success and Failure Flash Messages
- Adding Book
- Editing Book
- Logging In
- Logging Out
- Registration
Display Flash Messages on Pages
- add.php
- books.php
- edit.php
- index.php
- login.php
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
But we do not provide any information.
0:00
I think we should fix this and
show some sort of message.
0:01
When a message is only visible for
0:06
a single request,
this is called a flash message.
0:08
The Symfony HttpFoundation
package that we've been using
0:12
gives us a nice set of
features to do this.
0:16
We'll be using Sessions for this, and
attaching a message to its flashBag,
0:19
the storage area for all these messages.
0:23
The messages that are stored
here are automatically deleted
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up