I have working extended cLinkPager
class CLinkPagerExtended extends CLinkPager
{
/**
* @param null $owner
*/
public function __construct($owner = null)
{
$this->getPages()->pageVar = 'sPageNumber';
parent::__construct();
}
/**
* @param string $label
* @param int $page
* @param string $class
* @param bool $hidden
* @param bool $selected
*
* @return string
*/
protected function createPageButton($label, $page, $class, $hidden, $selected)
{
if (!strlen($label)) { // hide empty buttons
return '';
}
return parent::createPageButton($label, $page, $class, $hidden, $selected);
}
}
But, how can I change pageVar not through __construct() method?
$this->getPages()->pageVar = 'sPageNumber';
In all other cases I tried I have $_GET[‘page’] var that I’m not using! (I want to use $_GET[‘sPageNumber’]). I don’t know WHY some class adding to $_GET this var (btw it’s method in setCurrentPage() in cPagination class) but replacement is working ONLY from this __construct method in all other cases we will have TWO vars ‘page’ and (my custom) ‘sPageNumber’.