PHP Класс Contao\Pagination

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

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

Свойство Тип Описание
$arrData array Data array
$blnForceParam array Data array
$blnShowFirstLast boolean Show "<< first" and "last >>" links
$intNumberOfLinks integer Total number of links
$intPage integer Current page number
$intRows integer Total number of rows
$intRowsPerPage integer Number of rows per page
$intTotalPages integer Total number of pages
$lblFirst string Label for the "<< first" link
$lblLast string Label for the "last >>" link
$lblNext string Label for the "next >" link
$lblPrevious string Label for the "< previous" link
$lblTotal string Label for "total pages"
$objTemplate Template | object Template object
$strParameter string Page paramenter
$strUrl string Request url
$strVarConnector string Variable connector

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

Метод Описание
__construct ( integer $intRows, integer $intPerPage, integer $intNumberOfLinks = 7, string $strParameter = 'page', Template $objTemplate = null, boolean $blnForceParam = false ) Set the number of rows, the number of results per pages and the number of links
generate ( string $strSeparator = ' ' ) : string Generate the pagination menu and return it as HTML string
getItemsAsArray ( ) : array Generate all page links and return them as array
getItemsAsString ( string $strSeparator = ' ' ) : string Generate all page links separated with the given argument and return them as string
hasFirst ( ) : boolean Return true if the pagination menu has a "<< first" link
hasLast ( ) : boolean Return true if the pagination menu has a "last >>" link
hasNext ( ) : boolean Return true if the pagination menu has a "next >" link
hasPrevious ( ) : boolean Return true if the pagination menu has a "< previous" link

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

Метод Описание
linkToPage ( integer $intPage ) : string Generate a link and return the URL

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

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

Set the number of rows, the number of results per pages and the number of links
public __construct ( integer $intRows, integer $intPerPage, integer $intNumberOfLinks = 7, string $strParameter = 'page', Template $objTemplate = null, boolean $blnForceParam = false )
$intRows integer The number of rows
$intPerPage integer The number of items per page
$intNumberOfLinks integer The number of links to generate
$strParameter string The parameter name
$objTemplate Template The template object
$blnForceParam boolean Force the URL parameter

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

Generate the pagination menu and return it as HTML string
public generate ( string $strSeparator = ' ' ) : string
$strSeparator string The separator string
Результат string The pagination menu as HTML string

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

Generate all page links and return them as array
public getItemsAsArray ( ) : array
Результат array The page links as array

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

Generate all page links separated with the given argument and return them as string
public getItemsAsString ( string $strSeparator = ' ' ) : string
$strSeparator string The separator string
Результат string The page links as HTML string

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

Return true if the pagination menu has a "<< first" link
public hasFirst ( ) : boolean
Результат boolean True if the pagination menu has a "<< first" link

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

Return true if the pagination menu has a "last >>" link
public hasLast ( ) : boolean
Результат boolean True if the pagination menu has a "last >>" link

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

Return true if the pagination menu has a "next >" link
public hasNext ( ) : boolean
Результат boolean True if the pagination menu has a "next >" link

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

Return true if the pagination menu has a "< previous" link
public hasPrevious ( ) : boolean
Результат boolean True if the pagination menu has a "< previous" link

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

Generate a link and return the URL
protected linkToPage ( integer $intPage ) : string
$intPage integer The page ID
Результат string The URL string

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

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

Data array
protected array $arrData
Результат array

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

Data array
protected array $blnForceParam
Результат array

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

Show "<< first" and "last >>" links
protected bool $blnShowFirstLast
Результат boolean

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

Current page number
protected int $intPage
Результат integer

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

Total number of rows
protected int $intRows
Результат integer

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

Number of rows per page
protected int $intRowsPerPage
Результат integer

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

Total number of pages
protected int $intTotalPages
Результат integer

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

Label for the "<< first" link
protected string $lblFirst
Результат string

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

Label for the "last >>" link
protected string $lblLast
Результат string

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

Label for the "next >" link
protected string $lblNext
Результат string

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

Label for the "< previous" link
protected string $lblPrevious
Результат string

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

Label for "total pages"
protected string $lblTotal
Результат string

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

Template object
protected Template,contao|object $objTemplate
Результат Template | object

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

Page paramenter
protected string $strParameter
Результат string

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

Request url
protected string $strUrl
Результат string

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

Variable connector
protected string $strVarConnector
Результат string