Class Paginator (namespace Nette)


Paginating math.

Object
   |
   --Paginator
Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Paginator.php (line 30)
Public Method Summary
int
getBase ()
Returns first page (base) number.
int
Returns the absolute index of the first item on current page in countdown paging.
int
Returns first page number.
int
Returns the total number of items.
int
Returns the number of items to display on a single page.
int
Returns last page number.
int
Returns the number of items on current page.
int
Returns the absolute index of the first item on current page.
int
getPage ()
Returns current page number.
int
Returns the total number of pages.
array
getSteps ([$steps = 5], [$surround = 3])
Generates list of pages used for visual control. (experimental)
bool
isFirst ()
Is the current page the first one?
bool
isLast ()
Is the current page the last one?
void
setBase (int $base)
Sets first page (base) number.
void
setItemCount (int $itemCount)
Sets the total number of items.
void
setItemsPerPage (int $itemsPerPage)
Sets the number of items to display on a single page.
void
setPage (int $page)
Sets current page number.
Protected Method Summary
protected int
Returns zero-based page number.
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()

Method Details

line 107

getBase

public int getBase ()

Returns first page (base) number.

Output
int  

line 219

getCountdownOffset

public int getCountdownOffset ()

Returns the absolute index of the first item on current page in countdown paging.

Output
int  

line 73

getFirstPage

public int getFirstPage ()

Returns first page number.

Output
int  

line 197

getItemCount

public int getItemCount ()

Returns the total number of items.

Output
int  

line 174

getItemsPerPage

public int getItemsPerPage ()

Returns the number of items to display on a single page.

Output
int  

line 84

getLastPage

public int getLastPage ()

Returns last page number.

Output
int  

line 230

getLength

public int getLength ()

Returns the number of items on current page.

Output
int  

line 208

getOffset

public int getOffset ()

Returns the absolute index of the first item on current page.

Output
int  

line 62

getPage

public int getPage ()

Returns current page number.

Output
int  

line 151

getPageCount

public int getPageCount ()

Returns the total number of pages.

Output
int  

line 118

getPageIndex

protected int getPageIndex ()

Returns zero-based page number.

Output
int  

line 242

getSteps

public array getSteps ([$steps = 5], [$surround = 3])

Generates list of pages used for visual control. (experimental)

Input
$steps
$surround
Output
array  
Tags
Deprecated

line 129

isFirst

public bool isFirst ()

Is the current page the first one?

Output
bool  

line 140

isLast

public bool isLast ()

Is the current page the last one?

Output
bool  

line 96

setBase

public void setBase (int $base)

Sets first page (base) number.

Input
int $base
Output
void  

line 186

setItemCount

public void setItemCount (int $itemCount)

Sets the total number of items.

Input
int $itemCount (or FALSE as infinity)
Output
void  

line 163

setItemsPerPage

public void setItemsPerPage (int $itemsPerPage)

Sets the number of items to display on a single page.

Input
int $itemsPerPage
Output
void  

line 51

setPage

public void setPage (int $page)

Sets current page number.

Input
int $page
Output
void