PHP code example of facile-it / paginator-bundle

1. Go to this page and download the library: Download facile-it/paginator-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

facile-it / paginator-bundle example snippets


// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Facile\PaginatorBundle\FacilePaginatorBundle(),
        // ...
    );
}

// Acme\MainBundle\Controller\ProductController.php


    $queryBuilder = $this
        ->get('doctrine.orm.entity_manager')
        ->getRepository('AcmeMainBundle:Product')
        ->createQueryBuilder('product')

    $paginator = $this->get('facile.paginator')->parseRequest($this->getRequest());

    return $this->render('AcmeMainBundle:Product:list.html.twig', array(
        'results' => $pagination,
        'paginationInfo' => $paginator->getPaginationInfo($filterBuilder
        )
    );