src/Controller.php
protected function pagination( $total, $current, $pageSize, $around = 4 ) {
		$pageCount = ceil( $total / $pageSize );
		$first = max( 0, $current - $around );
		$last = min( max( 0, $pageCount - 1 ), $current + 4 );
		return [ $pageCount, $first, $last ];
	}
protected function pagination( $total, $current, $pageSize, $around = 4 ) {
		$pageCount = ceil( $total / $pageSize );
		$first = max( 0, $current - $around );
		$last = min( max( 0, $pageCount - 1 ), $current + 4 );
		return [ $pageCount, $first, $last ];
	}
protected function pagination ( $ total , $ current , $ pageSize , $ around = 4 ) { $ pageCount = ceil ( $ total / $ pageSize ) ; $ first = max ( 0 , $ current - $ around ) ; $ last = min ( max ( 0 , $ pageCount - 1 ) , $ current + 4 ) ; return [ $ pageCount , $ first , $ last ] ; }
Compute pagination data.

@param int $total Total records
@param int $current Current page number (0-indexed)
@param int $pageSize Number of items per page
@param int $around Numer of pages to show on each side of current
@return array Page count, first page index, last page index
Compute pagination data .