CONTROLADOR: data['Mylog']['action_id']; $mivar=$this->Mylog->Action->find("first", array("id" => $actionId)); //$mivar=$this->Action->read("null", $actionId); //$prize = $mivar["Action"]["prize"]; //$this->data["Myog"]["prize"] = $prize; debug($mivar); debug($this->data); } function admin_index() { $this->layout = 'admin'; $this->Mylog->recursive = 0; $this->set('mylogs', $this->paginate()); } function admin_view($id = null) { $this->layout = 'admin'; if (!$id) { $this->Session->setFlash('Invalid Mylog.'); $this->redirect(array('action'=>'index'), null, true); } $this->set('mylog', $this->Mylog->read(null, $id)); } function admin_add() { $this->layout = 'admin'; //echo "hola"; print_r($mivar); echo "hola"; //$actionId = $this->data['Mylog']['action_id']; //$mivar=$this->Mylog->Action->find("first", array("id" => $actionId)); //debug($mivar); if (!empty($this->data)) { $this->cleanUpFields(); $this->Mylog->create(); if ($this->Mylog->save($this->data)) { //$this->Session->setFlash('The Mylog has been saved'); $this->redirect(array('action'=>'index'), null, true); } else { //$this->Session->setFlash('The Mylog could not be saved. Please, try again.'); } } $domains = $this->Mylog->Domain->generateList(); $actions = $this->Mylog->Action->generateList(); $this->set(compact('domains', 'actions')); } function admin_edit($id = null) { $this->layout = 'admin'; if (!$id && empty($this->data)) { $this->Session->setFlash('Invalid Mylog'); $this->redirect(array('action'=>'index'), null, true); } if (!empty($this->data)) { $this->cleanUpFields(); if ($this->Mylog->save($this->data)) { $this->Session->setFlash('The Mylog has been saved'); $this->redirect(array('action'=>'index'), null, true); } else { $this->Session->setFlash('The Mylog could not be saved. Please, try again.'); } } if (empty($this->data)) { $this->data = $this->Mylog->read(null, $id); } $domains = $this->Mylog->Domain->generateList(); $actions = $this->Mylog->Action->generateList(); $this->set(compact('domains','actions')); } function admin_delete($id = null) { if (!$id) { $this->Session->setFlash('Invalid id for Mylog'); $this->redirect(array('action'=>'index'), null, true); } if ($this->Mylog->del($id)) { $this->Session->setFlash('Mylog #'.$id.' deleted'); $this->redirect(array('action'=>'index'), null, true); } } } ?> ------------------------------------------------------------------- VISTA: