示例#1
0
 public function beforeDelete()
 {
     foreach ($this->photo as $value) {
         $item = SiteImage::FindByPk($value->Pk);
         $this->deleteImage($item);
         $item->delete();
     }
     return parent::beforeDelete();
 }
示例#2
0
 public function beforeDelete()
 {
     foreach ($this->photo as $value) {
         $item = SiteImage::FindByPk($value->Pk);
         $this->deleteImage($item);
         $item->delete();
     }
     $tmp = new \SplFileInfo(ROOT_PATH_PUBLIC . $item->image);
     rmdir($tmp->getPath());
     return parent::beforeDelete();
 }
示例#3
0
 public function actionSaveImage()
 {
     $item = SiteImage::FindByPk($this->app->request->post->id);
     $item->title = $this->app->request->post->title;
     $item->save();
 }