works with plain silex-php
## Features
- Does not require initializing specific adapters
- Can be customized in any way needed, etc.: pagination view, event subscribers.
- Possibility to add custom filtering, sorting functionality depending on request parameters.
- Separation of concerns, paginator is responsible for generating the pagination view only, pagination view * for representation purposes.
- php: >=5.3.3,
- knplabs/knp-components: ~1.2,>=1.2.5,
- pimple/pimple: ~1.1,
- symfony/http-kernel: ~2.3,
- symfony/translation: ~2.3,
- twig/twig: ~1.2
## Installation
Through Composer as saxulum/saxulum-pagination-provider.
$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,
)
)
));
$container['knp_paginator']->paginate($target, 1, 10);