Thursday, December 4, 2008

Re: Form manipulation

Hi,
follow this code,

if(!empty($this->data)){
$this->data['User']['user_id'] = $this->Auth->user('id');
$this->data['User']['current_date'] = date('Y-m-d');
$this->User->save($this->data);
}

=======
for get the db driven select box,
use the find syntax with list attribute.
ex:
$this->User->find('find',array('list', array(
'conditions' => array(*** give conditions ***),
'fields' => array('User.id', 'User.name')
)
));

what u give in the fields attribute, will be reflected in the options
for the select box.

Enjoy Cake Bake.

Regards,
Krishnan Nair
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: