src/PHPDish/Bundle/PostBundle/Controller/PostController.php
public function deleteAction($id)
    {
        $manager = $this->getPostManager();
        $post = $manager->findPostById($id);
        if (!$post) {
            throw $this->createNotFoundException();
        }
        $this->denyAccessUnlessGranted('edit', $post);
        $manager->blockPost($post);

        return $this->handleView($this->view([
            'result' => true,
        ]));
    }
public function deleteAction($id)
    {
        $manager = $this->getPostManager();
        $post = $manager->findPostById($id);
        if (!$post) {
            throw $this->createNotFoundException();
        }
        $this->denyAccessUnlessGranted('edit', $post);
        $manager->blockPost($post);

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

@Route("/posts/{id}", name="post_delete", requirements={"id": "\d+"}, methods={"DELETE"})

@param int $id

@return Response