PHP code example of morozgrafix / paginator-twig-extension

1. Go to this page and download the library: Download morozgrafix/paginator-twig-extension 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/ */

    

morozgrafix / paginator-twig-extension example snippets


paginator(int current_page, int last_page, int num_items, string separator)

array (
  'curr_page' => 1,
  'last_page' => 10,
  'num_items' => 7,
  'separator' => '...',
  'pagination' => array (
    0 => 1,
    1 => 2,
    2 => 3,
    3 => 4,
    4 => 5,
    5 => '...',
    6 => 10,
  ),
)

array (
  'curr_page' => 10,
  'last_page' => 25,
  'num_items' => 11,
  'separator' => '¯\\_(ツ)_/¯',
  'pagination' => array (
    0 => 1,
    1 => '¯\\_(ツ)_/¯',
    2 => 7,
    3 => 8,
    4 => 9,
    5 => 10,
    6 => 11,
    7 => 12,
    8 => 13,
    9 => '¯\\_(ツ)_/¯',
    10 => 25,
  ),
)

array (
  'curr_page' => 420,
  'last_page' => 999,
  'num_items' => 11,
  'separator' => '...',
  'pagination' => array (
    0 => 1,
    1 => '...',
    2 => 417,
    3 => 418,
    4 => 419,
    5 => 420,
    6 => 421,
    7 => 422,
    8 => 423,
    9 => '...',
    10 => 999,
  ),
)