class ProfilesController extends AppController{ public function edit(){ $id=$this->Auth->user('id'); if($this->request->is(array('post','put'))) { $this->request->data['Profile']['user_id'] = $id; if ($this->Profile->save($this->request->data)) { $this->Session->setFlash(__('The profile has been saved.')); } } }