PHP Класс PagerModule, vanilla

Наследование: extends Module
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$ClientID The id applied to the div tag that contains the pager.
$CssClass The name of the stylesheet class to be applied to the pager. Default is 'Pager'.
$CurrentRecords The number of records in the current page.
$DefaultPageSize The default number of records per page.
$LessCode Translation code to be used for "less" link.
$Limit The number of records being displayed on a single page of data. Default is 30.
$MoreCode Translation code to be used for "Next Page" link.
$Offset The first record of the current page (the dataset offset).
$PagerEmpty If there are no pages to page through, this string will be returned in place of the pager. Default is an empty string.
$TotalRecords The total number of records in the dataset.
$Url The string to contain the record offset. ie. /controller/action/%s/
$UrlCallBack string
$Wrapper The xhtml code that should wrap around the pager link. ie. '
%2$s
'; where %1$s represents id and class attributes (if defined by $this->ClientID and $this->CssClass) and %2$s represents the pager link.

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

Свойство Тип Описание
$_CurrentPager PagerModule
$_Totalled A boolean value indicating if the total number of records is known or not. Retrieving this number can be a costly database query, so sometimes it is not retrieved and simple "next/previous" links are displayed instead. Default is FALSE, meaning that the simple pager is displayed.

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

Метод Описание
__construct ( string $Sender = '' )
assetTarget ( ) : boolean
configure ( $Offset, $Limit, $TotalRecords, $Url, boolean $ForceConfigure = false ) Define all required parameters to create the Pager and PagerDetails.
controller ( ) : Gdn_Controller. Gets the controller this pager is for.
current ( null $Value = null ) : null | PagerModule
details ( string $FormatString = '' ) : boolean | string Builds a string with information about the page list's current position (ie. "1 to 15 of 56").
firstPage ( ) : boolean Whether or not this is the first page of the pager.
formatUrl ( $Url, $Page, string $Limit = '' ) : mixed | string
hasMorePages ( ) Are there more pages after the current one?
lastPage ( ) : boolean Whether or not this is the last page of the pager.
pageUrl ( $Page ) : mixed | string
rel ( $Page, $CurrentPage ) : null | string
toString ( string $Type = 'more' ) : string Builds page navigation links.
toStringPrevNext ( string $Type = 'more' ) : string
write ( array $Options = [] )

Приватные методы

Метод Описание
_GetCssClass ( $ThisPage, $HighlightPage ) : string

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

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

public __construct ( string $Sender = '' )
$Sender string

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

public assetTarget ( ) : boolean
Результат boolean

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

Define all required parameters to create the Pager and PagerDetails.
public configure ( $Offset, $Limit, $TotalRecords, $Url, boolean $ForceConfigure = false )
$Offset
$Limit
$TotalRecords
$Url
$ForceConfigure boolean

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

Gets the controller this pager is for.
public controller ( ) : Gdn_Controller.
Результат Gdn_Controller.

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

public static current ( null $Value = null ) : null | PagerModule
$Value null
Результат null | PagerModule

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

Builds a string with information about the page list's current position (ie. "1 to 15 of 56").
public details ( string $FormatString = '' ) : boolean | string
$FormatString string
Результат boolean | string Built string.

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

Whether or not this is the first page of the pager.
public firstPage ( ) : boolean
Результат boolean True if this is the first page.

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

public static formatUrl ( $Url, $Page, string $Limit = '' ) : mixed | string
$Url
$Page
$Limit string
Результат mixed | string

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

Are there more pages after the current one?
public hasMorePages ( )

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

Whether or not this is the last page of the pager.
public lastPage ( ) : boolean
Результат boolean True if this is the last page.

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

public pageUrl ( $Page ) : mixed | string
$Page
Результат mixed | string

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

public static rel ( $Page, $CurrentPage ) : null | string
$Page
$CurrentPage
Результат null | string

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

Builds page navigation links.
public toString ( string $Type = 'more' ) : string
$Type string Type of link to return: 'more' or 'less'.
Результат string HTML page navigation links.

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

public toStringPrevNext ( string $Type = 'more' ) : string
$Type string
Результат string

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

public static write ( array $Options = [] )
$Options array

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

$ClientID публичное свойство

The id applied to the div tag that contains the pager.
public $ClientID

$CssClass публичное свойство

The name of the stylesheet class to be applied to the pager. Default is 'Pager'.
public $CssClass

$CurrentRecords публичное свойство

The number of records in the current page.
public $CurrentRecords

$DefaultPageSize публичное статическое свойство

The default number of records per page.
public static $DefaultPageSize

$LessCode публичное свойство

Translation code to be used for "less" link.
public $LessCode

$Limit публичное свойство

The number of records being displayed on a single page of data. Default is 30.
public $Limit

$MoreCode публичное свойство

Translation code to be used for "Next Page" link.
public $MoreCode

$Offset публичное свойство

The first record of the current page (the dataset offset).
public $Offset

$PagerEmpty публичное свойство

If there are no pages to page through, this string will be returned in place of the pager. Default is an empty string.
public $PagerEmpty

$TotalRecords публичное свойство

The total number of records in the dataset.
public $TotalRecords

$Url публичное свойство

The string to contain the record offset. ie. /controller/action/%s/
public $Url

$UrlCallBack публичное свойство

public string $UrlCallBack
Результат string

$Wrapper публичное свойство

The xhtml code that should wrap around the pager link. ie. '
%2$s
'; where %1$s represents id and class attributes (if defined by $this->ClientID and $this->CssClass) and %2$s represents the pager link.
public $Wrapper

$_CurrentPager защищенное статическое свойство

protected static PagerModule $_CurrentPager
Результат PagerModule

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

A boolean value indicating if the total number of records is known or not. Retrieving this number can be a costly database query, so sometimes it is not retrieved and simple "next/previous" links are displayed instead. Default is FALSE, meaning that the simple pager is displayed.
protected $_Totalled