PHP code example of saxulum / saxulum-pagination-provider

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

    

saxulum / saxulum-pagination-provider example snippets

{.php}
$container->register(new Saxulum\PaginationProvider\Silex\Provider\SaxulumPaginationProvider, array(
    'knp_paginator.options' => array(
        'defaultPaginationOptions' => array(
            'pageParameterName' => 'page',
            'sortFieldParameterName' => 'sort',
            'sortDirectionParameterName' => 'direction',
            'filterFieldParameterName' => 'filterField',
            'filterValueParameterName' => 'filterValue',
            'distinct' => true,
        ),
        'subscriberOptions' => array(
            'defaultPaginationTemplate' => '@SaxulumPaginationProvider/sliding.html.twig',
            'defaultSortableTemplate' => '@SaxulumPaginationProvider/sortable_link.html.twig',
            'defaultFiltrationTemplate' => '@SaxulumPaginationProvider/filtration.html.twig',
            'defaultPageRange' => 5,
        )
    )
));
{.php}
$container['knp_paginator']->paginate($target, 1, 10);