rendered paste body 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'));
}
-----------------------------------------------------------------------------------------------------------------------------------------------------
El debug saca esto:
Array
(
[Action] => Array
(
[id] => 1
[action] => Registrar Admin
[description] => Registrar un dominio Administrador
[group_id] => 2
[price] => 10
)
[Group] => Array
(
[id] => 2
[group] => Administradores
[description] => Administradores del sistema
[created] => 2007-11-21 13:20:09
[modified] => 2007-11-21 19:12:45
)
)