Guest User

Untitled

a guest
Jan 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. --Controller--
  2.  
  3. public function curso($id)
  4. {
  5.  
  6. $this->loadModel('ProgramaDisciplina');
  7.  
  8. if (!empty($this->data)) {
  9.  
  10.  
  11. $this->ProgramaDisciplinaCurso->set(array(
  12. 'curso' => $this->data['ProgramaDisciplinaCurso']['curso'],
  13. 'programa' => $id
  14. ));
  15. if ($this->ProgramaDisciplinaCurso->save()) {
  16. $this->Session->setFlash('Your post has been saved.');
  17. $this->redirect(array('action' => 'index'));
  18. }
  19.  
  20. if ($this->canceled()) {
  21. $this->redirect('/reitoria/programa_disciplina/');
  22. }
  23. }
  24. }
Add Comment
Please, Sign In to add comment