PHP Класс Pop\Paginator\Paginator

Автор: Nick Sagona, III ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$bookendKey integer Page bookend key
$bookends array Page bookends
$classOff string Class 'off' name for page link tags
$classOn string Class 'on' name for page link tags
$dateFormat string Date format for handle date strings
$end integer Current page end index property
$footer string Footer template
$header string Header template
$items array Content items
$links array Page links property
$numPages integer Number of pages property
$output string Page ouput
$perPage integer Items per page property
$range integer Page range property
$rem integer Remainder property
$rowTemplate string Row template
$separator string Bookend separator
$start integer Current page start index property
$total integer Total item count property

Открытые методы

Метод Описание
__construct ( array $items, integer $perPage = 10, integer $range = 10, integer $total = null ) : Paginator Constructor
__toString ( ) : string Output the rendered page
factory ( array $items, integer $perPage = 10, integer $range = 10, integer $total = null ) : Paginator Static method to instantiate the paginator object and return itself to facilitate chaining methods together.
getClassOff ( ) : string Method to get the class 'off' name.
getClassOn ( ) : string Method to get the class 'on' name.
getDateFormat ( ) : string Method to get the date format.
getFooter ( ) : string Method to get the footer template.
getHeader ( ) : string Method to get the header template.
getItemCount ( ) : integer Method to get the number of content items.
getItems ( ) : array Method to get the content items.
getLinks ( integer $pg = null ) : string Method to get the page links.
getPerPage ( ) : integer Method to get the page range.
getRange ( ) : integer Method to get the page range.
getRowTemplate ( ) : string Method to get the row template.
getSeparator ( ) : string Method to get the bookend separator.
getTotal ( ) : integer Method to get the content items total
render ( integer | string $pg, boolean $ret = false ) : mixed Method to render the current page.
setBookend ( integer $key = Paginator::SINGLE_ARROWS ) : Paginator Method to set the bookend key.
setClassOff ( string $cls ) : Paginator Method to set the class 'off' name.
setClassOn ( string $cls ) : Paginator Method to set the class 'on' name.
setDateFormat ( string $date = null ) : Paginator Method to set the date format.
setFooter ( string $ftr ) : Paginator Method to set the footer template.
setHeader ( string $hdr ) : Paginator Method to set the header template.
setItems ( array $items ) : Paginator Method to set the content items.
setPerPage ( integer $perPage = 10 ) : Paginator Method to set the page range.
setRange ( integer $range = 10 ) : Paginator Method to set the page range.
setRowTemplate ( string $tmpl ) : Paginator Method to set the row template.
setSeparator ( string $sep = ' | ' ) : Paginator Method to set the bookend separator.
setTotal ( integer $total = null ) : Paginator Method to set the content items total

Защищенные методы

Метод Описание
calcItems ( integer | string $p ) : void Method to calculate the page items.
calcRange ( integer | string $pg ) : array Method to calculate the page range.
createLinks ( integer $pg = null ) : void Method to create links.

Описание методов

__construct() публичный Метод

Instantiate the paginator object.
public __construct ( array $items, integer $perPage = 10, integer $range = 10, integer $total = null ) : Paginator
$items array
$perPage integer
$range integer
$total integer
Результат Paginator

__toString() публичный Метод

Output the rendered page
public __toString ( ) : string
Результат string

calcItems() защищенный Метод

Method to calculate the page items.
protected calcItems ( integer | string $p ) : void
$p integer | string
Результат void

calcRange() защищенный Метод

Method to calculate the page range.
protected calcRange ( integer | string $pg ) : array
$pg integer | string
Результат array

factory() публичный статический Метод

Static method to instantiate the paginator object and return itself to facilitate chaining methods together.
public static factory ( array $items, integer $perPage = 10, integer $range = 10, integer $total = null ) : Paginator
$items array
$perPage integer
$range integer
$total integer
Результат Paginator

getClassOff() публичный Метод

Method to get the class 'off' name.
public getClassOff ( ) : string
Результат string

getClassOn() публичный Метод

Method to get the class 'on' name.
public getClassOn ( ) : string
Результат string

getDateFormat() публичный Метод

Method to get the date format.
public getDateFormat ( ) : string
Результат string

getFooter() публичный Метод

Method to get the footer template.
public getFooter ( ) : string
Результат string

getHeader() публичный Метод

Method to get the header template.
public getHeader ( ) : string
Результат string

getItemCount() публичный Метод

Method to get the number of content items.
public getItemCount ( ) : integer
Результат integer

getItems() публичный Метод

Method to get the content items.
public getItems ( ) : array
Результат array

getPerPage() публичный Метод

Method to get the page range.
public getPerPage ( ) : integer
Результат integer

getRange() публичный Метод

Method to get the page range.
public getRange ( ) : integer
Результат integer

getRowTemplate() публичный Метод

Method to get the row template.
public getRowTemplate ( ) : string
Результат string

getSeparator() публичный Метод

Method to get the bookend separator.
public getSeparator ( ) : string
Результат string

getTotal() публичный Метод

Method to get the content items total
public getTotal ( ) : integer
Результат integer

render() публичный Метод

Method to render the current page.
public render ( integer | string $pg, boolean $ret = false ) : mixed
$pg integer | string
$ret boolean
Результат mixed

setBookend() публичный Метод

Method to set the bookend key.
public setBookend ( integer $key = Paginator::SINGLE_ARROWS ) : Paginator
$key integer
Результат Paginator

setClassOff() публичный Метод

Method to set the class 'off' name.
public setClassOff ( string $cls ) : Paginator
$cls string
Результат Paginator

setClassOn() публичный Метод

Method to set the class 'on' name.
public setClassOn ( string $cls ) : Paginator
$cls string
Результат Paginator

setDateFormat() публичный Метод

Method to set the date format.
public setDateFormat ( string $date = null ) : Paginator
$date string
Результат Paginator

setFooter() публичный Метод

Method to set the footer template.
public setFooter ( string $ftr ) : Paginator
$ftr string
Результат Paginator

setHeader() публичный Метод

Method to set the header template.
public setHeader ( string $hdr ) : Paginator
$hdr string
Результат Paginator

setItems() публичный Метод

Method to set the content items.
public setItems ( array $items ) : Paginator
$items array
Результат Paginator

setPerPage() публичный Метод

Method to set the page range.
public setPerPage ( integer $perPage = 10 ) : Paginator
$perPage integer
Результат Paginator

setRange() публичный Метод

Method to set the page range.
public setRange ( integer $range = 10 ) : Paginator
$range integer
Результат Paginator

setRowTemplate() публичный Метод

Method to set the row template.
public setRowTemplate ( string $tmpl ) : Paginator
$tmpl string
Результат Paginator

setSeparator() публичный Метод

Method to set the bookend separator.
public setSeparator ( string $sep = ' | ' ) : Paginator
$sep string
Результат Paginator

setTotal() публичный Метод

Method to set the content items total
public setTotal ( integer $total = null ) : Paginator
$total integer
Результат Paginator

Описание свойств

$bookendKey защищенное свойство

Page bookend key
protected int $bookendKey
Результат integer

$bookends защищенное свойство

Page bookends
protected array $bookends
Результат array

$classOff защищенное свойство

Class 'off' name for page link tags
protected string $classOff
Результат string
Date format for handle date strings
protected string $dateFormat
Результат string

$end защищенное свойство

Current page end index property
protected int $end
Результат integer

$header защищенное свойство

Header template
protected string $header
Результат string

$items защищенное свойство

Content items
protected array $items
Результат array

$numPages защищенное свойство

Number of pages property
protected int $numPages
Результат integer

$output защищенное свойство

Page ouput
protected string $output
Результат string

$perPage защищенное свойство

Items per page property
protected int $perPage
Результат integer

$range защищенное свойство

Page range property
protected int $range
Результат integer

$rem защищенное свойство

Remainder property
protected int $rem
Результат integer

$rowTemplate защищенное свойство

Row template
protected string $rowTemplate
Результат string

$separator защищенное свойство

Bookend separator
protected string $separator
Результат string

$start защищенное свойство

Current page start index property
protected int $start
Результат integer

$total защищенное свойство

Total item count property
protected int $total
Результат integer