Beispiel #1
0
 /**
  *
  */
 public function actionDropzoneDelete()
 {
     $req = Yii::$app->request;
     Yii::$app->response->format = 'json';
     if ($req->isPost) {
         $upload = Upload::find()->where(['id' => $req->post('uploadId')])->one();
         if ($upload and $upload->delete()) {
             return ['id' => $req->post('uploadId'), 'message' => 'Successful Deletion'];
         }
     }
 }
Beispiel #2
0
 public function getImage()
 {
     return $this->hasOne(Upload::className(), ['id' => 'image_id']);
 }