0

我正在处理 cakePHP 会话 setFlash(),它不会在视图上显示消息我阅读了它包含消息的会话。我的消息,

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

我检查了会话,

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

上述记录器的结果是,

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 (),
    ),
 )

请帮助我为什么不显示闪存消息。

4

1 回答 1

2

你写了吗

var $helpers = array('Session');

在您的控制器中?

如果您已声明,您是否尝试过回显

$this->Session->flash()

在你看来?

可能有原因在视图文件中显示消息。

于 2013-06-18T08:31:52.280 回答