Skip to content

Instantly share code, notes, and snippets.

@dodopok
Created June 12, 2013 13:09
Show Gist options
  • Save dodopok/5765094 to your computer and use it in GitHub Desktop.
Save dodopok/5765094 to your computer and use it in GitHub Desktop.
Salvar - CakePHP
<?php
public function add() {
if ($this->request->is('post')) {
$this->Tabela->create();
if ($this->Tabela->save($this->request->data)) {
$this->Session->setFlash(__('A Tabela foi cadastrada.'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('A Tabela não pôde ser cadastrada. Favor tentar novamente.'));
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment