user2484678
user2484678

Reputation: 31

Unable to set the flash message in cakePHP

i am working on cakePHP session setFlash(),it does not display the message on the view i read the session it contains the message.My message,

$this->Session->setFlash('Uploaded the file successfully.', Messages::MSG_INFO);

i checked the session,

LogUtil::$logger->debug('Session Data     :'.var_export($this->Session->read('Message'),true));

The Result of the Above Logger is,

array (
    'auth' => array (
        'message' => 'Login failed. Invalid username or password.',
        'element' => 'msg_error',
        'params' => array (),
    ),
    'flash' => array (
        'message' => 'Uploaded the file successfully.',
        'element' => 'msg_info',
        'params' => array (),
    ),
 )

please help me why the flash message is not displayed.

Upvotes: 0

Views: 588

Answers (1)

liyakat
liyakat

Reputation: 11853

have you write

var $helpers = array('Session');

in your controller?

If you you have declared it, did you try echoing

$this->Session->flash()

in your view?

there might be causes to display message in view files.

Upvotes: 2

Related Questions