コード例 #1
0
ファイル: ManageController.php プロジェクト: griga/m22-cms
 /**
  *
  */
 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'];
         }
     }
 }
コード例 #2
0
ファイル: Content.php プロジェクト: griga/m22-cms
 public function getImage()
 {
     return $this->hasOne(Upload::className(), ['id' => 'image_id']);
 }