Hi why is it that in the add function you use $this->data when saving
and in the edit function you use $this->data['Post']?

function add() {
                if (!empty($this->data)) {
                        if ($this->Post->save($this->data)) {
                                $this->flash('Your post has been 
saved.','/posts');
                        }
                }
        }

function edit($id = null) {
        $this->Post->id = $id;
        if (empty($this->data)) {
                $this->data = $this->Post->read();
        } else {
                if ($this->Post->save($this->data['Post'])) {
                        $this->flash('Your post has been updated.','/posts');
                }
        }
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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