PHP code example of dariuszp / paginator

1. Go to this page and download the library: Download dariuszp/paginator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dariuszp / paginator example snippets


$paginator = new \Dariuszp\Paginator\Paginator\Simple(
    '/article?page={page}&onPage={onPage}',
    $itemsAmount,
    4, // current page
    10, // items per page
    2, // amount of links on the left and right of the current page
    true, // show next page link
    true, // show prev page link
    true, // show first page link
    true // show last page link
);

$data = $paginator->getData();

$render = new \Dariuszp\Paginator\Render\Spaghetti();
$html = $render->render($data);

echo $html;