PHP code example of fdevs / pagination-bridge

1. Go to this page and download the library: Download fdevs/pagination-bridge 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/ */

    

fdevs / pagination-bridge example snippets



// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new FDevs\Bridge\Pagination\FDevsPaginationBundle(),
        // ...
    );
}


use Symfony\Component\DependencyInjection\ContainerBuilder;
use FDevs\Bridge\Pagination\DependencyInjection\FDevsPaginationExtension;

$container = new ContainerBuilder();
// $container configuration...

$container->registerExtension(FDevsPaginationExtension());

$paginator = $container->get('f_devs_pagination.paginator');


// init you target
$target = ..
// example $target = $em->createQuery('SELECT a FROM Entity\Article a');

$paginator->paginate($target);