Okay, here's what's going on . I am using $this->Session because
$session in the controller causes it blow up.

$this->data += array('User' => array('user_id' => $this->Session-
>read
('User.user_id')));
$this->Project->saveAll($this->data);

However, now when it saves it doesn't grab the value of user_id stored
in the Session. It should insert the value 1 for the user_id but
instead inserts 0

Am I supposed to set something up in order to use $this->Session in my
controller?

Thanks,

Chris







On Mar 21, 9:12 pm, mscdex <[email protected]> wrote:
> On Mar 21, 9:11 pm, cpeele <[email protected]> wrote:
>
> > Thanks for the help guys. I appreciate it. The reason I need to do
> > this is I need to associate a submitted item (in this case a project)
> > with the logged in user. Is there another way to do this then?
>
> One solution would be to remove the hidden form field and instead
> append a new array containing the user_id to $this->data right before
> you call saveAll:
>
> $this->data += array('User' => array('user_id' => $session->read
> ('User.user_id')));
> $this->Project->saveAll($this->data);
--~--~---------~--~----~------------~-------~--~----~
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