/** * Creates a new pagination * @param int $total_count of items to paginates * @param int $current_page * @param int $per_page : number of items per page * @param $base_url of the pagination links * @param $page_get_key : the $_GET parameter * @param $merge_get : merge $_GET with the pagination $_GET parameter ($page_get_key) */ public function __construct($total_count, $current_page = 1, $per_page = 10, $base_url = "", $page_get_key = 'page', $merge_get = true) { $this->total_count = (int) $total_count; $this->current_page = (int) $current_page; $this->per_page = (int) $per_page; $this->base_url = (string) $base_url; $this->merge_get = (bool) $merge_get; $this->page_get_key = (string) $page_get_key; parent::__construct("div"); $this->get_document(); $this->attr("class", "pagination"); }
/** * Creates a new pagination * @param int $total_count of items to paginates * @param int $current_page * @param int $per_page : number of items per page * @param $base_url of the pagination links * @param $page_get_key : the $_GET parameter * @param $merge_get : merge $_GET with the pagination $_GET parameter ($page_get_key) */ public function __construct($total_count, $current_page = 1, $per_page = 10, $base_url = "", $page_get_key = 'page', $merge_get = true) { $this->total_count = (int) $total_count; $this->current_page = (int) $current_page; $this->per_page = (int) $per_page; $this->base_url = (string) $base_url; $this->merge_get = (bool) $merge_get; $this->page_get_key = (string) $page_get_key; # https://code.google.com/p/add-mvc-framework/issues/detail?id=154 if ($this->current_page <= 0) { throw new e_system("Invalid current page argument", func_get_args()); } parent::__construct("div"); $this->get_document(); $this->attr("class", "pagination"); }