Guest User

Untitled

a guest
Jan 22nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. function edit($id = null){
  2. if(!$id){
  3. $this->Session->setFlash('Tarea invalida');
  4. $this->redirect(array('action'=>'index'),null,true);
  5. }
  6. if(empty($this->data)){
  7. $this->data = $this->Tarea->find(array('id'=>$id));
  8. }else{
  9. if($this->Tarea->save($this->data)){
  10. $this->Session->setFlash('La tarea ha sido salvada');
  11. $this->redirect(array('action'=>'index'),null,true);
  12. }else{
  13. $this->Session->setFlash('La tarea no ha podido ser salvada. Intentelo de nuevo');
  14. }
  15. }
  16. }
Add Comment
Please, Sign In to add comment