vnphp/paginator-bundle

Useful KNP paginator extensions.

v0.1 2017-01-11 12:48 UTC

This package is auto-updated.

Last update: 2024-04-14 18:01:27 UTC


README

build status code quality

Installation

composer require vnphp/paginator-bundle

You need to have git installed.

Usage

Add the bundle to your AppKernel.php:

<?php 

$bundles = array(          
            new \Vnphp\PaginatorBundle\VnphpPaginatorBundle(),
        );

Usage

<?php

if ($page > 1) {
    $limit = 20;
    $paginatorOffset = -1;
} else {
    $limit = 19;
    $paginatorOffset = 0;
}

$this->paginator->paginate($query, $page, $limit, [
    'offset' => $paginatorOffset,
]);