Example #1
0
 public function deleteAction()
 {
     $this->view->autoRender = false;
     $id = $this->getParam('id');
     if (!$id) {
         $id = $this->getRequest()->getPost('id');
     }
     $dbObject = new Application_Model_DbTable_Albums();
     $deleteResult = $dbObject->deleteAlbum($id);
     // render the index page after deleting the data.
     $this->_helper->redirector('index');
 }
Example #2
0
 public function deleteAction()
 {
     if ($this->getRequest()->isPost()) {
         $del = $this->getRequest()->getPost('del');
         if ($del == 'Yes') {
             $id = $this->getRequest()->getPost('id');
             $albums = new Application_Model_DbTable_Albums();
             $albums->deleteAlbum($id);
         }
         $this->_helper->redirector('index');
     } else {
         $id = $this->_getParam(id, 0);
         $albums = new Application_Model_DbTable_Albums();
         $this->view->album = $albums->getAlbum($id);
     }
 }