Skip to content
This repository has been archived by the owner on Apr 21, 2018. It is now read-only.

saxulum-legacy/saxulum-pagination-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

saxulum-pagination-provider

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

About

A pimple/twig integration of the knplabs pagination

Resources

License

Stars

Watchers

Forks

Packages

No packages published