saxulum/saxulum-pagination-provider

This package is abandoned and no longer maintained. No replacement package was suggested.

Saxulum Pagination Provider

2.1.2 2015-12-19 18:01 UTC

This package is not auto-updated.

Last update: 2020-09-22 19:09:06 UTC


README

works with plain silex-php

Build Status Total Downloads Latest Stable Version Scrutinizer Code Quality

## 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.

Requirements

  • 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.

Configuration

$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,
        )
    )
));

Usage

$container['knp_paginator']->paginate($target, 1, 10);