Skip to content

Instantly share code, notes, and snippets.

@zmiftah
Last active October 12, 2015 08:28
Show Gist options
  • Select an option

  • Save zmiftah/3999482 to your computer and use it in GitHub Desktop.

Select an option

Save zmiftah/3999482 to your computer and use it in GitHub Desktop.
PHP: Simple Class Paginator v0.1
<?php
class Paginator {
var $per_page;
var $total;
var $list;
var $period;
public function __construct( $per_page, $total ) {
$this->per_page = $per_page;
$this->total = $total;
$this->period = 7;
return $this;
}
public function execute() {
$html = '
<div class="pagination">
<ul>
{0}
</ul>
</div>';
$total_page = ceil( $this->total / $this->per_page );
if ( $total_page > 7 ) {
# code...
}
}
public function display() {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment