Hi Hendry,

Thanks - didn't fix it though - still no data being added to the
'username' field automatically yet. :(

On Jul 4, 9:21 pm, Hendry <hendry....@gmail.com> wrote:
> Hi,
>
> should be Post not Posts:
>
> $this->data['Post']['username'] = $this->Auth->user('username');
>
> Regards,
> Hendry
>
> On Sun, Jul 5, 2009 at 2:58 AM, eMilk<emil.kja...@gmail.com> wrote:
> > This is my PostsController::add():
> >        function add() {
> >                        if (!empty($this->data)) {
> >                                $this->data['Posts']['username'] = 
> > $this->Auth->user
> > ('username');
> >                        if  ($this->Post->save($this->data)) {
> >                                $this->Session->setFlash('Your robot has 
> > been saved.');
> >                                $this->redirect(array('action' => 'index'));
> >                        }
> >                }
> >        }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to