PHP code example of scrnr / pagination

1. Go to this page and download the library: Download scrnr/pagination 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/ */

    

scrnr / pagination example snippets




// Include the namespace
use Scrnr\Pagination\Pagination;

// Require the Composer autoload file
 [
  'isGetPagination' => true,
  'currentPage' => (int) ($_GET['page'] ?? 1),
  'limitItems' => 50,
  'limitPages' => 15,
  'totalItems' => 500,
];

// Get the pagination links
$links = $pagination->getPagination($options);

// Display the pagination links
echo $links;