Friday, September 30, 2011

Re: I can find() but can't save(), why?

Return "Entro" so it goes trough (!empty($this->data)) :-(

Ing. Reynier Pérez Mira
Cel: +58 416.921.7406
Correo: reynierpm@gmail.com / reynierpm@hotmail.com



On Fri, Sep 30, 2011 at 4:10 AM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
Try this:

if (!empty($this->data)) {
$this->Modalidad->create();
if ($this->Modalidad->save($this->data)) {
die("Entro");
} else {
$this->Session->setFlash('Ocurrieron errores salvando los datos', 'default', array('class' => 'example_class'));
die(debug($this->Modalidad->validationErrors));
}
/* you don't need to use $this->render(), so get rid of it
} else {
$this->render();
 */
}

Jeremy Burns

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
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

No comments: