Interesting observation. I didn't see that when I first started. Anyway I just use $this->Model->save($this->data) for both Add and Edit methods. As far as I know, the key difference is the presence of a hidden $id field in the form.
On Jul 4, 6:57 pm, "vinh.chuc" <[EMAIL PROTECTED]> wrote: > Hi ! > I'm learning cakephp, i juste read the blog tutorial, but there is > something i didn't understand : > > in the add method, this line saves the data to the model : > > $this->Post->save($this->data) > > while, in the edit methode, it's this line : > > $this->Post->save($this->data['Post']) > > What's the exact difference between the two ? why "data" fot the add > method and "data['Post']" for the edit one ?? > > thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
