src/PHPDish/Bundle/PostBundle/Controller/BookController.php
public function viewAction($slug, Request $request)
    {
        $book = $this->getBookManager()->findBook($slug);
        return $this->render($this->configuration->getTemplate('Book:view.html.twig'), [
            'book' => $book,
        ]);
    }
public function viewAction($slug, Request $request)
    {
        $book = $this->getBookManager()->findBook($slug);
        return $this->render($this->configuration->getTemplate('Book:view.html.twig'), [
            'book' => $book,
        ]);
    }
查看电子书

@Route("/books/{slug}", name="book_view", requirements={"slug": "[\w-]+"})
@param string $slug
@param Request $request
@return Response