src/PHPDish/Bundle/PostBundle/Controller/PostController.php
public function getUserPostsAction($username, Request $request)
    {
        $user = $this->getUserManager()->findUserByName($username);
        $posts = $this->getPostManager()->findUserEnabledPosts($user, $request->query->getInt('page', 1));

        return $this->render($this->configuration->getTemplate('Post:user_posts.html.twig'), [
            'user' => $user,
            'posts' => $posts,
        ]);
    }
public function getUserPostsAction($username, Request $request)
    {
        $user = $this->getUserManager()->findUserByName($username);
        $posts = $this->getPostManager()->findUserEnabledPosts($user, $request->query->getInt('page', 1));

        return $this->render($this->configuration->getTemplate('Post:user_posts.html.twig'), [
            'user' => $user,
            'posts' => $posts,
        ]);
    }
用户文章.

@Route("/users/{username}/posts", name="user_posts")

@param string  $username
@param Request $request

@return Response