Ejemplo n.º 1
0
 /**
  * 删除
  */
 public function actionDelete()
 {
     $this->blogId = isset($_GET['blogId']) ? $_GET['blogId'] : 0;
     if ($this->blogId) {
         $nowblog = $this->markdown->getBlogById($this->blogId);
         if (empty($nowblog)) {
             $this->jumpBox('没有此文档!', Wave::app()->homeUrl, 1);
         }
         $filePath = ROOT_PATH . '/data/md/' . $nowblog['fileName'];
         if (file_exists($filePath)) {
             unlink($filePath);
         }
         $FileClass = new FileClass();
         $FileClass->rmdirs(ROOT_PATH . '/data/caches');
         $this->jumpBox('删除成功!', Wave::app()->homeUrl, 1);
     } else {
         $this->jumpBox('请选择文档!', Wave::app()->homeUrl, 1);
     }
 }