top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to display flash messages in CakePHP?

0 votes
388 views
How to display flash messages in CakePHP?
posted Jul 31, 2014 by Mohit Sharma

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

To set a message, use setFlash:
You need to use setflash method of session to set your message.
// In the controller.
$this->Session->setFlash('Your stuff has been saved.');

Use the following code in your .ctp file where you wnat to display the message.

echo $this->Session->flash();

This will display the message in your .ctp file

answer Aug 1, 2014 by Rahul Mahajan
...