src/PHPDish/Bundle/PostBundle/Controller/CommentController.php
public function deleteAction($id)
    {
        $manager = $this->getPostCommentManager();
        $comment = $manager->findCommentById($id);

        if (!$comment) {
            throw $this->createNotFoundException();
        }
        $this->denyAccessUnlessGranted('edit', $comment);

        $manager->blockComment($comment);

        return $this->handleView($this->view([
            'result' => true,
        ]));
    }
public function deleteAction($id)
    {
        $manager = $this->getPostCommentManager();
        $comment = $manager->findCommentById($id);

        if (!$comment) {
            throw $this->createNotFoundException();
        }
        $this->denyAccessUnlessGranted('edit', $comment);

        $manager->blockComment($comment);

        return $this->handleView($this->view([
            'result' => true,
        ]));
    }
删除评论.

@Route("/comments/{id}", name="comment_delete")
@Method("DELETE")

@param int $id

@return Response