Пример #1
0
 public function deletaAction()
 {
     $noticias = new Application_Model_DbTable_Noticias();
     $request = $this->getRequest();
     $where = "idNoticias = " . $request->getParam('id');
     $arquivo = $request->getParam('img');
     if (file_exists($arquivo)) {
         unlink($arquivo);
     }
     $resultado = $noticias->delete($where);
     if ($resultado) {
         echo "<script> alert('ERRO'); </script>";
         $this->_redirect('/');
     } else {
         echo "<script> alert('ERRO'); </script> ";
     }
 }