Hi all,

I am new to CakePHP and i am building a small app.
i use Session->setFlash('message') to display notifications to the
users .
The notification is displayed in the default layout and i delete the
flash messega from the session using this code
<code>
if ($session->check('Message.flash')) {
    $message = $session->read('Message.flash') ;
    if($message['message'] != '') {
        if(is_array($message['message'])) {
            $text = "" ;
            foreach ($message['message'] as $mes) {
                $text = $mes ."<br>" ;
            }
        }
        else $text = $message['message'];
<div id="flash" class='message2 success'>
     <p><?php echo $text; ?></p>
</div>
        <?php $session->flash() ?>
    }
}
</code>
My problem is that notification are displayed randomly , ie : it seems
that the flash message is not deleted from the session.
PS : using another layout for ajax calls i also delete the flash
message in this layout.

Thanks in advance for your help

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to