class Pagination (View source)

The Pagination class.

Constants

BASE_PAGE

Number of the first page

FIRST

First page

LESS

The page before the previous neighbour pages

PREVIOUS

Previous pages

LOWER

Previous pages

CURRENT

Current page

HIGHER

Next pages

NEXT

Next pages

MORE

The page after the next neighbour pages

LAST

Last page

Methods

static Pagination
simple(int $current, int $limit = 10)

simple

__construct(int $current, int $limit = 10, int $total, int $neighbours = 4)

Create instance

build()

Display

int
getTotal()

Method to get property Total

total(int $total)

Method to set property total

int
getCurrent()

Method to get property Current

currentPage(int $current)

Method to set property current

int
getOffset()

Method to get property Offset

offset(int $offset)

Method to set property offset

getResult()

Method to get property Result

setResult(PaginationResult $result)

Method to set property result

string
render()

render

getRouter()

Method to get property Route

setRouter(RouteBuilderInterface $router)

Method to set property route

route(string $route, array $query = array(), string $type = MainRouter::TYPE_PATH)

route

neighbours(int $neighbours)

Method to set property neighbours

int
getNeighbours()

Method to get property Neighbours

int
getLimit()

Method to get property Limit

limit(int $limit)

Method to set property limit

int
getPages()

Method to get property Pages

pages(int $pages)

Method to set property pages

array
getTemplate()

Method to get property Template

template(string $layout, string $engine = 'php')

Method to set property template

Details

at line line 163
static Pagination simple(int $current, int $limit = 10)

simple

Parameters

int $current
int $limit

Return Value

Pagination

at line line 176
__construct(int $current, int $limit = 10, int $total, int $neighbours = 4)

Create instance

Parameters

int $current Number of the current page
int $limit Items per page
int $total Total items
int $neighbours Number of neighboring pages at the left and the right sides

at line line 220
Pagination build()

Display

Return Value

Pagination

at line line 295
int getTotal()

Method to get property Total

Return Value

int

at line line 307
Pagination total(int $total)

Method to set property total

Parameters

int $total

Return Value

Pagination Return self to support chaining.

at line line 319
int getCurrent()

Method to get property Current

Return Value

int

at line line 331
Pagination currentPage(int $current)

Method to set property current

Parameters

int $current

Return Value

Pagination Return self to support chaining.

at line line 343
int getOffset()

Method to get property Offset

Return Value

int

at line line 355
Pagination offset(int $offset)

Method to set property offset

Parameters

int $offset

Return Value

Pagination Return self to support chaining.

at line line 367
PaginationResult getResult()

Method to get property Result

Return Value

PaginationResult

at line line 381
Pagination setResult(PaginationResult $result)

Method to set property result

Parameters

PaginationResult $result

Return Value

Pagination Return self to support chaining.

at line line 393
string render()

render

Return Value

string

at line line 461
RouteBuilderInterface getRouter()

Method to get property Route

Return Value

RouteBuilderInterface

at line line 473
Pagination setRouter(RouteBuilderInterface $router)

Method to set property route

Parameters

RouteBuilderInterface $router

Return Value

Pagination Return self to support chaining.

at line line 489
Pagination route(string $route, array $query = array(), string $type = MainRouter::TYPE_PATH)

route

Parameters

string $route
array $query
string $type

Return Value

Pagination

at line line 507
Pagination neighbours(int $neighbours)

Method to set property neighbours

Parameters

int $neighbours

Return Value

Pagination Return self to support chaining.

at line line 519
int getNeighbours()

Method to get property Neighbours

Return Value

int

at line line 529
int getLimit()

Method to get property Limit

Return Value

int

at line line 541
Pagination limit(int $limit)

Method to set property limit

Parameters

int $limit

Return Value

Pagination Return self to support chaining.

at line line 553
int getPages()

Method to get property Pages

Return Value

int

at line line 565
Pagination pages(int $pages)

Method to set property pages

Parameters

int $pages

Return Value

Pagination Return self to support chaining.

at line line 577
array getTemplate()

Method to get property Template

Return Value

array

at line line 590
Pagination template(string $layout, string $engine = 'php')

Method to set property template

Parameters

string $layout
string $engine

Return Value

Pagination Return self to support chaining.