PHP Класс yii\widgets\LinkPager

LinkPager works with a [[Pagination]] object which specifies the total number of pages and the current page number. Note that LinkPager only generates the necessary HTML markups. In order for it to look like a real pager, you should provide some CSS styles for it. With the default configuration, LinkPager should look good using Twitter Bootstrap CSS framework. For more details and usage information on LinkPager, see the guide article on pagination.
С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends yii\base\Widget
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$activePageCssClass the CSS class for the active (currently selected) page button.
$disabledListItemSubTagOptions the options for the disabled tag to be generated inside the disabled list element. In order to customize the html tag, please use the tag key. php $disabledListItemSubTagOptions = ['tag' => 'div', 'class' => 'disabled-div'];
$disabledPageCssClass the CSS class for the disabled page buttons.
$firstPageCssClass the CSS class for the "first" page button.
$firstPageLabel the text label for the "first" page button. Note that this will NOT be HTML-encoded. If it's specified as true, page number will be used as label. Default is false that means the "first" page button will not be displayed.
$hideOnSinglePage Hide widget when only one page exist.
$lastPageCssClass the CSS class for the "last" page button.
$lastPageLabel the text label for the "last" page button. Note that this will NOT be HTML-encoded. If it's specified as true, page number will be used as label. Default is false that means the "last" page button will not be displayed.
$linkOptions HTML attributes for the link in a pager container tag.
$maxButtonCount maximum number of page buttons that can be displayed. Defaults to 10.
$nextPageCssClass the CSS class for the "next" page button.
$nextPageLabel the label for the "next" page button. Note that this will NOT be HTML-encoded. If this property is false, the "next" page button will not be displayed.
$options HTML attributes for the pager container tag.
$pageCssClass the CSS class for the each page button.
$pagination the pagination object that this pager is associated with. You must set this property in order to make LinkPager work.
$prevPageCssClass the CSS class for the "previous" page button.
$prevPageLabel the text label for the previous page button. Note that this will NOT be HTML-encoded. If this property is false, the "previous" page button will not be displayed.
$registerLinkTags whether to register link tags in the HTML header for prev, next, first and last page. Defaults to false to avoid conflicts when multiple pagers are used on one page.

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

Метод Описание
init ( ) Initializes the pager.
run ( ) Executes the widget.

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

Метод Описание
getPageRange ( ) : array
registerLinkTags ( ) Registers relational link tags in the html header for prev, next, first and last page.
renderPageButton ( string $label, integer $page, string $class, boolean $disabled, boolean $active ) : string Renders a page button.
renderPageButtons ( ) : string Renders the page buttons.

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

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

protected getPageRange ( ) : array
Результат array the begin and end pages that need to be displayed.

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

Initializes the pager.
public init ( )

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

These links are generated using [[\yii\data\Pagination::getLinks()]].
См. также: http://www.w3.org/TR/html401/struct/links.html#h-12.1.2
protected registerLinkTags ( )

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

You may override this method to customize the generation of page buttons.
protected renderPageButton ( string $label, integer $page, string $class, boolean $disabled, boolean $active ) : string
$label string the text label for the button
$page integer the page number
$class string the CSS class for the page button.
$disabled boolean whether this page button is disabled
$active boolean whether this page button is active
Результат string the rendering result

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

Renders the page buttons.
protected renderPageButtons ( ) : string
Результат string the rendering result

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

This overrides the parent implementation by displaying the generated page buttons.
public run ( )

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

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

the CSS class for the active (currently selected) page button.
public $activePageCssClass

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

the options for the disabled tag to be generated inside the disabled list element. In order to customize the html tag, please use the tag key. php $disabledListItemSubTagOptions = ['tag' => 'div', 'class' => 'disabled-div'];
С версии: 2.0.11
public $disabledListItemSubTagOptions

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

the CSS class for the disabled page buttons.
public $disabledPageCssClass

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

the CSS class for the "first" page button.
public $firstPageCssClass

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

the text label for the "first" page button. Note that this will NOT be HTML-encoded. If it's specified as true, page number will be used as label. Default is false that means the "first" page button will not be displayed.
public $firstPageLabel

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

Hide widget when only one page exist.
public $hideOnSinglePage

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

the CSS class for the "last" page button.
public $lastPageCssClass

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

the text label for the "last" page button. Note that this will NOT be HTML-encoded. If it's specified as true, page number will be used as label. Default is false that means the "last" page button will not be displayed.
public $lastPageLabel

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

HTML attributes for the link in a pager container tag.
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $linkOptions

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

maximum number of page buttons that can be displayed. Defaults to 10.
public $maxButtonCount

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

the CSS class for the "next" page button.
public $nextPageCssClass

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

the label for the "next" page button. Note that this will NOT be HTML-encoded. If this property is false, the "next" page button will not be displayed.
public $nextPageLabel

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

HTML attributes for the pager container tag.
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $options

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

the CSS class for the each page button.
С версии: 2.0.7
public $pageCssClass

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

the pagination object that this pager is associated with. You must set this property in order to make LinkPager work.
public $pagination

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

the CSS class for the "previous" page button.
public $prevPageCssClass

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

the text label for the previous page button. Note that this will NOT be HTML-encoded. If this property is false, the "previous" page button will not be displayed.
public $prevPageLabel

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

whether to register link tags in the HTML header for prev, next, first and last page. Defaults to false to avoid conflicts when multiple pagers are used on one page.
См. также: http://www.w3.org/TR/html401/struct/links.html#h-12.1.2
См. также: registerLinkTags()
public $registerLinkTags