hello friends, I am VERY new to all the cakePHP methods, so, any help
would be much appreciated.
I have built my database tables and have Baked all Models,
Controllers, and Views. Everything is working as expected with the
relations and interaction with the db tables.
I am now trying to customize the view, add, and edit functions. The
main thing I need to do is make many of the views, User.id specific
and can't for the life of me figure out the best way to do that.
Here is a sample of code of what I am trying to do. I just want the
add form to grab the current User.id for saving to the database.
function writer_add() {
if (!empty($this->data)) {
$this->Writer->create();
if ($this->Writer->save($this->data)) {
$this->Session->setFlash(__('The Writer has
been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Writer could
not be saved.
Please, try again.', true));
}
}
$users = $this->Writer->User->find('first', array('User' =>
'User.id'));
$this->set(compact('users'));
}
Thanks so much
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---