dkx/paginator

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

Paginator with paginator factory

0.2.1 2019-11-02 11:20 UTC

This package is auto-updated.

Last update: 2024-01-29 03:27:59 UTC


README

Paginator with factory

Installation

$ composer require dkx/paginator

Usage

<?php

use DKX\Paginator\PaginatorFactory;

$itemsPerPage = 20;
$base = 1;

$factory = new PaginatorFactory();
$factory->setItemsPerPage($itemsPerPage);
$factory->setBase($base);

$totalCount = 5000;
$currentPage = 3;

$paginator = $factory->create($totalCount, $currentPage);

PaginatedData

PaginatedData is a class which can wrap data from database and add information about pagination.

<?php

use DKX\Paginator\PaginatedData;

$data = $repository->getUsers();
$paginatedData = new PaginatedData($paginator, $data);