That fixed it. Thanks for your help!

Daniel

On Mar 9, 12:42 pm, Jeremy Burns | Class Outfit
<[email protected]> wrote:
> That's slightly old syntax. Try echo $this->Session->flash();
>
> Jeremy Burns
> Class Outfit
>
> [email protected]http://www.classoutfit.com
>
> On 8 Mar 2011, at 23:25, Daniel wrote:
>
> > Hi everyone. I've been working through the book "Beginning CakePHP"
> > and have hit a stumbling block at Chapter 6. I can't get my flash
> > message to appear when there's an error! My baked Posts Controller has
> > the function:
>
> > function view($id = null)
> > {
> >            if (!$id) {
> >                    $this->Session->setFlash(__('Invalid post', true));
> >                    $this->redirect(array('action' => 'index'));
> >            }
> >            $this->set('post', $this->Post->read(null, $id));
> >    }
>
> > I have added the line "<? $session->flash();?>" as instructed to the
> > body of the layout default.ctp. If I understand this correctly the
> > message "Invalid post" should appear if I don't provide an id for the
> > view function, however I can't get the message to appear. It seems to
> > redirect, but not output the message. Is there something simple I'm
> > missing?
>
> > Any advice would be much appreciated!
>
> > Cheers,
> > Daniel
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > [email protected] For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to