There is no difference. You can use both, but in the latter case You have to add Comment to the "uses" array of the controller, so $this->Post->Comment->save() is better way
On Jan 24, 11:38 am, bob <[EMAIL PROTECTED]> wrote: > This is a newbie question. In the cakephp manual > (http://manual.cakephp.org/chapter/models) > > $this->data['Comment']['post_id'] = $post_id; > > //Because our Post hasMany Comments, we can access > //the Comment model through the Post model: > > $this->Post->Comment->save($this->data); > > Why do we need to do $this->Post->Comment->save($this->data) instead of > simply $this->Comment->save($this->data)? what difference does it make in > this case, since we know the specific post_id? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---