/**
*设置当前页码css样式的class名称
*
*@paramstring$csscss样式名称
*@returnvoid
*/
publicfunctionsetCurrentPageCss($css){
$this->curPageCss=$css;
}
/**
*设置各分页码的样式,即style属性
*
*@paramstring$stylestyle样式
*@returnvoid
*/
publicfunctionsetPageStyle($style){
$this->pageStyle=$style;
}
/**
*设置当前页码的样式,即style属性
*
*@paramstring$stylestyle样式
*@returnvoid
*/
publicfunctionsetCurrentPageStyle($style){
$this->curPageStyle=$style;
}
/**
*设置地址链接中页码与变量的连接符,如page=2中的“=”
*
*@paramstring$symbol连接符号
*@returnvoid
*/
publicfunctionsetLinkSymbol($symbol){
$this->linkSymbol=$symbol;
}
/**
*获取总页数
*
*@accessprivate
*@returninteger
*/
publicfunctiongetTotalPageNum(){
return$this->totalPageNum;
}
/**
*设置是否显示第一页与最后一页的链接
*
*@paramboolean$istrue:显示,false:不显示
*@returnvoid
*/
publicfunctionisShowFirstAndLast($is){
$this->isShowFirstLast=$is;
}
/**
*设置当只有一页时是否显示分页
*
*@paramboolean$istrue:显示,false:不显示
*@returnvoid
*/
publicfunctionisShowForSimplePage($is){
$this->isShowForSimplePage=$is;
}
/**
*构造方法
*
*@paraminteger$eachDisNums每页显示的条目数
*@paraminteger$nums总条目数
*@paraminteger$current_num当前被选中的页
*@paraminteger$showPageNum每次显示的页数
*@paraminteger$subPageLink每个分页的链接
*@paraminteger$subPage_type显示分页的类型
*@returnvoid
*/
publicfunction__construct($eachDisNums,$nums,$currentPage,
$subPageLink){
$this->eachDisNums=intval($eachDisNums);
$nums=$nums==0?1:$nums;
$this->nums=intval($nums);
$this->totalPageNum=ceil($nums/$eachDisNums);
$this->currentPage=intval($currentPage);
$this->currentPage= $this->currentPage<=0?1:
$this->currentPage;
$this->currentPage=$this->currentPage>$this->totalPageNum?
1:$this->currentPage;
$this->subPageLink=$subPageLink;
$this->lastPageText='..'.$this->totalPageNum;
}
publicfunction__destruct(){
unset($this->eachDisNums);
unset($this->nums);
unset($this->currentPage);
unset($this->showPageNum);
unset($this->curIndexPage);
unset($this->totalPageNum);
unset($this->arrPage);
unset($this->subPageLink);
unset($this->firstPageText);
unset($this->lastPageText);
unset($this->prePageText);
unset($this->nextPageText);
unset($this->pageCss);
unset($this->curPageCss);
unset($this->pageStyle);
unset($this->curPageStyle);
unset($this->linkSymbol);
unset($this->isShowFirstLast);
unset($this->isShowForSimplePage);
}