class VideosController extends AppController { public $name = 'Videos'; public $uses = array('Video','Tv','User'); public $helpers = array('Html', 'Form', 'Javascript'); public $components = array('Thumbnail'); function add () { if (! empty($this->request->data)) { if ($this->Video->save($this->request->data)) { $this->Session->setFlash('Video added!'); $this->redirect('/users/view/'.$this->request->data['Video']['user_id'].''); } } } function delete($id,$userId) { $this->Video->del($id, false); $this->Session->setFlash('Video deleted!'); $this->redirect('/users/view/'.$userId.''); } }?>