Last active
October 1, 2015 07:37
-
-
Save jamband/1947229 to your computer and use it in GitHub Desktop.
Yii Framework: Example extending CLinkPager class.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class LinkPager extends CLinkPager | |
{ | |
/** | |
* @see CLinkPager::init() | |
*/ | |
public function init() | |
{ | |
$this->firstPageLabel = '««'; | |
$this->prevPageLabel = '«'; | |
$this->nextPageLabel = '»'; | |
$this->lastPageLabel = '»»'; | |
$this->htmlOptions['id'] = $this->getId(); | |
$this->htmlOptions['class'] = 'pager'; | |
} | |
/** | |
* @see CLinkPager::run() | |
*/ | |
public function run() | |
{ | |
$buttons = $this->createPageButtons(); | |
if (empty($buttons)) { | |
return; | |
} | |
echo CHtml::tag('ul', $this->htmlOptions, implode("\n", $buttons)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment