pclib
3.0.0
Lightweight PHP framework
|
Provides paginator calculations and rendering of the grid pager. More...
Public Member Functions | |
__construct ($length, $baseUrl) | |
Create pager. More... | |
setPage ($page) | |
Set active (selected) page. More... | |
setLength ($length) | |
Set total number of rows. More... | |
setPageLen ($pageLen) | |
Set number of rows of the page. More... | |
getValue ($id) | |
Return value of the pager item. More... | |
getUrl ($page) | |
Return pager url for the $page. More... | |
getHtml ($id, $cssClass='page-item', $pattern=null) | |
Return HTML for the pager link or other item. More... | |
html () | |
Return pager html. More... | |
Public Member Functions inherited from BaseObject | |
loadDefaults ($className=null) | |
Load default parameters of class $className into object instance. | |
setProperties (array $defaults) | |
Set public properties of object from the array. More... | |
toArray () | |
Convert object to array. More... | |
Data Fields | |
$linkNumber = 10 | |
Number of page-links shown in pager. | |
$baseUrl = '/?' | |
Base url for pager links. | |
$pattern = '%s | %s | %s' | |
Pattern for rendering. More... | |
$patternItem = '<span class="%s">%s</span>' | |
Pattern for rendering of the pager item. | |
$translator | |
var Translator | |
Data Fields inherited from BaseObject | |
$serviceLocator | |
var function() Return service object when requested with service(). | |
Protected Member Functions | |
clamp ($num, $min, $max) | |
Shift $num value into interval <$min, $max>. More... | |
getPagesHtml () | |
Return links to all pages. More... | |
pagerRange ($page, $size) | |
Return array of page numbers arround active page. More... | |
Protected Member Functions inherited from BaseObject | |
service ($service, $default=null) | |
Try acquire $service and load it into property $this->$service. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from BaseObject | |
static | defaults () |
Set or retireve default parameters of the object. More... | |
Provides paginator calculations and rendering of the grid pager.
__construct | ( | $length, | |
$baseUrl | |||
) |
Create pager.
int | $length | Total number of rows. |
string | $baseUrl |
|
protected |
Shift $num value into interval <$min, $max>.
getHtml | ( | $id, | |
$cssClass = 'page-item' , |
|||
$pattern = null |
|||
) |
Return HTML for the pager link or other item.
string | $id | Id of pager item |
string | $cssClass |
|
protected |
Return links to all pages.
getUrl | ( | $page | ) |
Return pager url for the $page.
int | $page |
getValue | ( | $id | ) |
Return value of the pager item.
string | $id | Id of pager item |
html | ( | ) |
Return pager html.
|
protected |
Return array of page numbers arround active page.
int | $page | Active page |
int | $size | Size of returned array |
setLength | ( | $length | ) |
Set total number of rows.
int | $length |
setPage | ( | $page | ) |
Set active (selected) page.
int | $page |
setPageLen | ( | $pageLen | ) |
Set number of rows of the page.
int | $pageLen |
$pattern = '%s | %s | %s' |
Pattern for rendering.
"first | last | pages" by default.