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 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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to