Last active
October 12, 2015 08:28
-
-
Save zmiftah/3999482 to your computer and use it in GitHub Desktop.
PHP: Simple Class Paginator v0.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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