Skip to content

Instantly share code, notes, and snippets.

@jamband
Last active October 1, 2015 07:37
Show Gist options
  • Save jamband/1947229 to your computer and use it in GitHub Desktop.
Save jamband/1947229 to your computer and use it in GitHub Desktop.
Yii Framework: Example extending CLinkPager class.
<?php
class LinkPager extends CLinkPager
{
/**
* @see CLinkPager::init()
*/
public function init()
{
$this->firstPageLabel = '&laquo;&laquo;';
$this->prevPageLabel = '&laquo;';
$this->nextPageLabel = '&raquo;';
$this->lastPageLabel = '&raquo;&raquo;';
$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