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
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

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