On Wed, August 11, 2010 12:08 pm, james wrote:
> Is it possible when submitting a form to grab the id of the user that
> has entered the data?
>
> I would guess you would grab Auth.User.username but then how would you
> enter that into the field thats to be saved?
just grab $this->Auth->user('id');
and save that as $this->data['Model']['user_id'] = $this->Auth->user('id');
easy peasy.
--
Mike Karthauser
Managing Director - Brightstorm Ltd
Email: [email protected]
Web: http://www.brightstorm.co.uk
Tel: 07939 252144 (mobile)
Fax: 0870 1320560
Address: 1 Brewery Court, North Street, Bristol, BS3 1JS
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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