Hi Jeremy,

Thanks for your reply.
It did not work with me , is there any other alternative to
setFlash() ?

Greetings.
On May 20, 7:16 pm, Jeremy Burns <jeremybu...@me.com> wrote:
> Seems like overkill to me. Just use $this->Session->setFlash('Here is my 
> message');  Then do echo $this->Session->flash(); - this not only displays 
> your message but also clears it out of the cache.
>
> Jeremy Burns
> jeremybu...@me.com
>
> On 20 May 2010, at 18:16, sami_bk wrote:
>
>
>
> > 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 sitehttp://cakeqs.organd 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 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 
> athttp://groups.google.com/group/cake-php?hl=en

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