PHP 클래스 Pop\Paginator\Paginator

저자: Nick Sagona, III ([email protected])
파일 보기 프로젝트 열기: nicksagona/PopPHP 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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