#Paginator
- get the pagination data
- use the data for custom html/style
#Example
//config
$pagePerSection = 5;
$itemPerPag = 10;
$paginator = new \Ilex\Utility\Paginator($pagePerSection, $itemPerPage);
//sql count
$itemTotal = 35; // select count from tableName where colName = 'DoReMe'
$currentPage = is_set($page)?$page:1;
$paginator->setCurentPage($itemTotal, $currentPage);
// sql for find item
$yourItem = ; // select somthing from tableName where colName = 'DoReMe'
// limit {$paginator->getSqlOffset()} , {$paginator->getSqlLimit()}
#View (html or template system )
<?php if( $paginator->hasPreviousPage() ) {?>
<a href="url?page=<?=$paginator->getPreviousPage()?>">Previous Page</a>
<?php } ?>
<?php $start = $paginator->getPageSectionStart() ;
$end = $paginator->getPageSectionEnd() ;
for ( $i = $start ; $i <= $end ; $i++ ) { ?>
<?php if ( $i == $paginator->currentPage ) { ?>
<span style="color:green;font-weight:bold;">[<?=$i?>]</span>
<?php } else { ?>
<a href="url?page=<?=$i?>"><?=$i?></a>
<?php } ?>
<?php } ?>
<?if( $paginator->hasNextPage() ) {?>
<a href="url?page=<?=$paginator->getNextPage()?>">Next Page</a>
<? } ?>
can use ul li or div just you like. add any css class just you like.