This is an old revision of the document!
Table of Contents
Paginator
Layer: Core · Source: lib/core/Paginator.php:17 (lines 17–265)
class Paginator
Docblock Metadata
| Tag | Value |
|---|---|
@category | Core Class |
@author | David Carr - [email protected] - http://www.daveismyname.com |
@version | 1.0 |
@since | October 20, 2012 |
Inheritance
No parent, interface or trait. This is a root type.
Constants (0)
None.
Properties (2)
| Visibility | Type | Name | Default | Line |
|---|---|---|---|---|
private | (untyped) | $_totalRows | 10; | 47 |
private | (untyped) | $_paginationHtml | ''; | 58 |
Methods (13)
| Visibility | Method | Summary | Line |
|---|---|---|---|
| public | __construct() | __construct | 68 |
| private | get_start() | get_start | 84 |
| private | set_instance() | set_instance | 97 |
| public | set_total() | set_total | 111 |
| public | get_limit() | get_limit | 122 |
| public | get_limit_keys() | get_limit_keys | 137 |
| public | page_links() | page_links | 151 |
| private | buildPageNumbers() | (undocumented) | 189 |
| private | buildPageLink() | (undocumented) | 213 |
| private | buildAllPages() | (undocumented) | 223 |
| private | buildEarlyPages() | (undocumented) | 230 |
| private | buildMiddlePages() | (undocumented) | 240 |
| private | buildLatePages() | (undocumented) | 255 |
__construct()
public function __construct($perPage, $instance)
lines 68–75 (8)
pass values when class is istantiated
| Parameter | Type | Default | Description |
|---|---|---|---|
$perPage | (untyped) | required | none |
$instance | (untyped) | required | none |
get_start()
private function get_start()
lines 84–87 (4)
creates the starting point for limiting the dataset
Takes no parameters.
Returns: (none declared) — integer
set_instance()
private function set_instance()
lines 97–102 (6)
sets the instance parameter, if numeric value is 0 then set to 1
Takes no parameters.
Returns: (none declared)
set_total()
public function set_total($_totalRows)
lines 111–114 (4)
collect a numberic value and assigns it to the totalRows
| Parameter | Type | Default | Description |
|---|---|---|---|
$_totalRows | (untyped) | required | none |
Returns: (none declared)
get_limit()
public function get_limit(Sanitize $sanitize)
lines 122–127 (6)
returns the limit for the data source, calling the get_start method and passing in the number of items perp page
| Parameter | Type | Default | Description |
|---|---|---|---|
$sanitize | ''Sanitize'' | required | none |
Returns: (none declared)
get_limit_keys()
public function get_limit_keys()
lines 137–140 (4)
returns an array of the offset and limit returned on each call
Takes no parameters.
Returns: (none declared) — string
page_links()
public function page_links(Sanitize $sanitize, $path = '?', $ext = null)
lines 151–187 (37)
create the html links for navigating through the dataset
| Parameter | Type | Default | Description |
|---|---|---|---|
$sanitize | ''Sanitize'' | required | none |
$path | (untyped) | '?' | none |
$ext | (untyped) | null | none |
Returns: (none declared) — string returns the html menu
buildPageNumbers()
private function buildPageNumbers($path, $ext, $adjacents, $lastpage, $lpm1)
lines 189–211 (23)
| Parameter | Type | Default | Description |
|---|---|---|---|
$path | (untyped) | required | none |
$ext | (untyped) | required | none |
$adjacents | (untyped) | required | none |
$lastpage | (untyped) | required | none |
$lpm1 | (untyped) | required | none |
Returns: (none declared)
buildPageLink()
private function buildPageLink($counter, $path, $ext)
lines 213–221 (9)
| Parameter | Type | Default | Description |
|---|---|---|---|
$counter | (untyped) | required | none |
$path | (untyped) | required | none |
$ext | (untyped) | required | none |
Returns: (none declared)
buildAllPages()
private function buildAllPages($path, $ext, $lastpage)
lines 223–228 (6)
| Parameter | Type | Default | Description |
|---|---|---|---|
$path | (untyped) | required | none |
$ext | (untyped) | required | none |
$lastpage | (untyped) | required | none |
Returns: (none declared)
buildEarlyPages()
private function buildEarlyPages($path, $ext, $adjacents, $lastpage, $lpm1)
lines 230–238 (9)
| Parameter | Type | Default | Description |
|---|---|---|---|
$path | (untyped) | required | none |
$ext | (untyped) | required | none |
$adjacents | (untyped) | required | none |
$lastpage | (untyped) | required | none |
$lpm1 | (untyped) | required | none |
Returns: (none declared)
buildMiddlePages()
private function buildMiddlePages($path, $ext, $adjacents, $lastpage, $lpm1)
lines 240–253 (14)
| Parameter | Type | Default | Description |
|---|---|---|---|
$path | (untyped) | required | none |
$ext | (untyped) | required | none |
$adjacents | (untyped) | required | none |
$lastpage | (untyped) | required | none |
$lpm1 | (untyped) | required | none |
Returns: (none declared)
buildLatePages()
private function buildLatePages($path, $ext, $adjacents, $lastpage, $lpm1)
lines 255–264 (10)
| Parameter | Type | Default | Description |
|---|---|---|---|
$path | (untyped) | required | none |
$ext | (untyped) | required | none |
$adjacents | (untyped) | required | none |
$lastpage | (untyped) | required | none |
$lpm1 | (untyped) | required | none |
Returns: (none declared)
This page is generated from source by 'tools/gendoc'. Edits will be overwritten.
