AppBundle\Controller\BlogController::indexAction PHP Method

indexAction() public method

public indexAction ( $page )
    public function indexAction($page)
    {
        $query = $this->getDoctrine()->getRepository('AppBundle:Post')->queryLatest();
        $paginator = $this->get('knp_paginator');
        $posts = $paginator->paginate($query, $page, Post::NUM_ITEMS);
        $posts->setUsedRoute('blog_index_paginated');
        return $this->render('blog/index.html.twig', array('posts' => $posts));
    }