src/PHPDish/Bundle/PostBundle/Controller/BookController.php
public function getUserBooksAction($username, Request $request)
    {
        $user = $this->getUserManager()->findUserByName($username);
        $books = $this->getBookManager()->findUserBooks($user);
        return $this->render($this->configuration->getTemplate('Book:user_books.html.twig'), [
            'user' => $user,
            'books' => $books
        ]);
    }
public function getUserBooksAction($username, Request $request)
    {
        $user = $this->getUserManager()->findUserByName($username);
        $books = $this->getBookManager()->findUserBooks($user);
        return $this->render($this->configuration->getTemplate('Book:user_books.html.twig'), [
            'user' => $user,
            'books' => $books
        ]);
    }
查看用户的电子书

@Route("/users/{username}/books", name="user_books")

@param string  $username
@param Request $request

@return Response