public function actionDeleteCommentPhoto() { $post = Yii::$app->request->post(); CommentsPhoto::deleteCommentPhoto($post['id']); }
public function actionDeleteComment() { $post = Yii::$app->request->post(); $commentId = $post['commentId']; if (Yii::$app->user->isGuest) { echo json_encode(['status' => 0]); return; } if (CommentsPhoto::isMyComment($commentId)) { CommentsPhoto::deleteCommentPhoto($commentId); } echo json_encode(['status' => '1']); }