示例#1
0
 public function executeDeleteFile()
 {
     $cat_file = CatalogFilePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($cat_file);
     $cat_file->delete();
     return $this->redirect('catalog/edit?id=' . $this->getRequestParameter('catalog_id'));
 }
示例#2
0
 public function executeDeleteFile()
 {
     $cat_file = CatalogFilePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($cat_file);
     $tmp_dir = sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR;
     unlink($tmp_dir . DIRECTORY_SEPARATOR . $cat_file->getFile());
     $cat_file->delete();
     return $this->redirect('collection/edit?id=' . $this->getRequestParameter('catalog_id'));
 }