I am using:
$this->Session->setFlash('gotcha!!', 'msg_success');
to write a msg in the Session and try to access it in the file
\app\views\elements\msg_success.ctp
with the code
if($session->check('Message.flash'))
{
echo $session->flash();
}
My Phpinfo() says
memory_limit 512M 512M
My app/config/core.php says
Configure::write('Session.save', 'php');
Configure::write('Session.cookie', 'CAKEPHP');
Configure::开发者_JAVA百科write('Session.start', true);
how can that be???
Make sure you have the Session Component and the Session Helper set in the controller. They are not on by default. Although, I would assume it would throw an error, not eat up your memory.
Also, you shouldn't need to do if($session->check('Message.flash'))
before using $this->Session->flash()
. It should degrade gracefully if no flash message has been set.
in your msg_success.ctp
, try just using
<?= $message; ?>
精彩评论