or rather $this->Auth->user('id');
On Feb 17, 4:07 pm, labianchin <[email protected]> wrote:
> Hi.
>
> In the controller action method you can use something like:
> $this->data['ModelName']['user_id'] = $this->Session-
>
> >read('Auth.User.id');
>
> On 18 fev, 00:57, barricades <[email protected]> wrote:
>
> > Hi there, I've searched through a bunch of tutorials but no-one seems
> > to explain this particular situation. I have a model for users and a
> > model for what I call campaigns, which a logged in user is allowed to
> > create. So I've got Auth up and running and the relationship set up so
> > a campaign belongs to a user.
>
> > So the user logs in and is directed to the create campaign action. In
> > the form that the user fills in, I want the users_id to be the id of
> > the currently logged in user by default.
>
> > echo $this->Form->input('user_id');
>
> > I know this is probably dead simple, but all the tutorials I've been
> > through don't tell me. The blog tutorial(s) there is only one possible
> > user; in the TOR tutorial its a drop down list to select which dealer
> > etc... etc...
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php