src/PHPDish/Bundle/PostBundle/Controller/BookController.php
public function editSummaryAction($slug, $id, Request $request)
    {
        $book = $this->getBookManager()->findBook($slug);
        $this->denyAccessUnlessGranted('edit', $book);
        $chapter = $this->getBookManager()->findChapter($id);
        $chapter->setTitle($request->request->get('title'));
        $this->getPostManager()->savePost($chapter);
        return $this->handleView($this->view([
            'chapter' => $chapter
        ])->setContext((new Context())->setGroups(['Default'])));
    }
public function editSummaryAction($slug, $id, Request $request)
    {
        $book = $this->getBookManager()->findBook($slug);
        $this->denyAccessUnlessGranted('edit', $book);
        $chapter = $this->getBookManager()->findChapter($id);
        $chapter->setTitle($request->request->get('title'));
        $this->getPostManager()->savePost($chapter);
        return $this->handleView($this->view([
            'chapter' => $chapter
        ])->setContext((new Context())->setGroups(['Default'])));
    }
修改目录

@Route("/books/{slug}/summary/{id}/edit", name="book_edit_summary")
@Method("POST")
@param string  $slug
@param int  $id
@param Request $request

@return Response