public function deleteAction($id) { $model = Video::findFirst($id); if ($this->request->isPost()) { $model->delete(); $this->redirect('/video/admin'); } $this->view->model = $model; }
public function indexAction() { $id = (int) $this->dispatcher->getParam('id', 'int'); $video = Video::findFirst($id); $videos = Video::find(array('order' => 'sortorder ASC')); $this->helper->title()->append($video->getTitle()); $this->view->video = $video; $this->view->videos = $videos; }