public function indexAction() { $this->setTitle('Wideo'); $this->setUrl('wideo.html'); $videoService = new Wsm_Db_Video(); $this->addToView('videoList', $videoService->getList()); }
public function saveAction() { $video = new Wsm_Video(); if ($this->has('id')) { $video->setId($this->get('id')); } $video->setYoutube($this->get('youtube')); $videoService = new Wsm_Db_Video(); try { $videoService->save($video); $this->redirect('video/index?msg=saved'); } catch (Exception $e) { $this->redirect('video/index?msg=save_error'); } }