src/PHPDish/Bundle/PostBundle/Controller/BookController.php
public function moveChapterAction($slug, $id, Request $request)
    {
        $book = $this->getBookManager()->findBook($slug);
        $this->denyAccessUnlessGranted('edit', $book);
        $chapter = $this->getBookManager()->findChapter($id);
        $this->getBookManager()->moveBookChapter($book, $chapter,
            $request->request->get('direction'),
            $request->request->get('step')
        );
        return $this->handleView($this->view([
            'chapter' => $chapter
        ])->setContext((new Context())->setGroups(['Default'])));
    }
public function moveChapterAction($slug, $id, Request $request)
    {
        $book = $this->getBookManager()->findBook($slug);
        $this->denyAccessUnlessGranted('edit', $book);
        $chapter = $this->getBookManager()->findChapter($id);
        $this->getBookManager()->moveBookChapter($book, $chapter,
            $request->request->get('direction'),
            $request->request->get('step')
        );
        return $this->handleView($this->view([
            'chapter' => $chapter
        ])->setContext((new Context())->setGroups(['Default'])));
    }
移动章节

@Route("/books/{slug}/chapters/{id}/move", name="book_move_chapter")
@param string $slug
@param int $id
@param Request $request
@return Response