public function deleteAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $id = $this->_getParam('id', null); if (!empty($id)) { $mysql = new Application_Model_DbTable_Albums(); $mysql->remove($id); } $this->_redirect('/admin/albums'); }
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'); }
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); } }
public function supprimerAction() { if ($this->getRequest()->isPost()) { $supprimer = $this->getRequest()->getPost('supprimer'); if ($supprimer == 'Oui') { $id = $this->getRequest()->getPost('id'); $albums = new Application_Model_DbTable_Albums(); $albums->supprimerAlbum($id); } $this->_helper->redirector('index'); } else { $id = $this->_getParam('id', 0); $albums = new Application_Model_DbTable_Albums(); $this->view->album = $albums->obtenirAlbum($id); } }