Created
May 5, 2014 02:41
-
-
Save braulioholtz/3a165ecdbe01160c7d55 to your computer and use it in GitHub Desktop.
ClientesController.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($this->request->is('post') || $this->request->is('put')) { | |
if ($this->Cliente->save($this->request->data)) { | |
$this->Cliente->saveAssociated($this->request->data); | |
$this->Session->setFlash('O cliente foi editado com sucesso!', | |
'alert', array( 'plugin' => 'BoostCake', 'class' => 'alert-success' )); | |
$this->redirect(array('action' => 'index')); | |
} else { | |
$this->Session->setFlash('O cliente não foi editado. Tente novamente.', 'alert', array( | |
'plugin' => 'BoostCake', 'class' => 'alert-error' | |
)); | |
} | |
} else { | |
$this->request->data = $this->Cliente->read(); | |
$this->set('clientes', $this->Cliente->read()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment