index = $index; $this->class = $index->getPageIndexClass(); } public function html_main() { self::paginate($this->index, $this->class); } public static function paginate(PageIndex $index, $class = null) { $page_index = $index->getPageIndex(); if (empty($page_index) || count($page_index) == 1) return; if (!isset($class)) $class = $index->getPageIndexClass(); echo '