Yii Clinkpager显示接下来的3个按钮,最后3个按钮

guys! I need some help. I need display pagination in the following view: 1 2 3 ... 98 99 100. How can I do that in Clinkpager? I have tried override method createButtons, but really I don't know what conditions :

   for($i=$beginPage;$i<=$endPage;++$i){

            if($this->maxButtonCount < $pageCount){

                $next = $currentPage + 3;
                if($currentPage <= $next || $currentPage >= $pageCount-3){
                    $buttons[]=$this->createPageButton($i+1,$i,$this->internalPageCssClass,false,$i==$currentPage);
                }
            }else{
                $buttons[]=$this->createPageButton($i+1,$i,$this->internalPageCssClass,false,$i==$currentPage);
            }



    }

But it not work.