PHP code example of microparts / paginateformatter-php

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

    

microparts / paginateformatter-php example snippets


use Pagerfanta\Adapter\ArrayAdapter;
use Pagerfanta\Pagerfanta;
use Microparts\PaginateFormatter\PaginateFormatter;

$adapter = new ArrayAdapter($array);
$pagerfanta = new Pagerfanta($adapter);
$paginate = new PaginateFormatter($pagerfanta);

$paginate->format(); // returns formatted output.

use Pagerfanta\Adapter\ArrayAdapter;
use Pagerfanta\Pagerfanta;
use Microparts\PaginateFormatter\PaginateFormatter;

$adapter = new ArrayAdapter($array);
$pagerfanta = new Pagerfanta($adapter);
$paginate = new PaginateFormatter($pagerfanta);

$paginate->setItems($transformedModel)->format();
bash
composer install microparts/paginateformatter-php