The Session Helper's flash method outputs the content, it doesn't
return it. It returns true if it has something to output, false if it
doesn't.

Your trailing '1' is you echoing the return value of flash, which you
shouldn't do - look in /libs/view/templates/layouts/default.ctp :

                        <?php
                                if ($session->check('Message.flash')):
                                                $session->flash();
                                endif;
                        ?>

Anyway, just do `$session->flash()'`, not `echo $session->flash();`



On Dec 13, 10:39 am, "dr. Hannibal Lecter" <[EMAIL PROTECTED]>
wrote:
> Hi everyone,
>
> here's my problem. I've started doing a private CMS to learn Cake.
> Now, at first I was working with the pre-beta download of 1.2 branch,
> and everything was going fine until I wanted to write my first
> flash()..
>
> All I did was: $this->Session->setFlash('Article saved');
> And in the view: echo $session->flash();
>
> Now the fun part: my output was: "Article saved1".
>
> Where the heck is that "1" coming from? I've tried everything, even
> searching for "1" through my code. Couple of days ago, I decided to
> get the latest revision from Cake repo thinking to myself "that's
> gotta be a bug somewhere in Cake".. I've upgraded successfully but
> it's still the same, I still get "1" at the end of any flash message.
>
> For now I'm just using $Session->write(...) and $session->read(...),
> and that works perfectly normal. But if I try flashing, ..well, you
> get the picture.
>
> Anyone had anything like this? Any clues?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to