My page number is like:
Page:1 2 3 4 5 last
But I want to change it like:
<< first | < previous | 1 | ... | 5 | next > | last >>
How to change this?
My code is:
<?php
$this->widget('CLinkPager', array(
'currentPage' => $pages->getCurrentPage(),
'itemCount' => $item_count,
'pageSize' => $page_size,
//'linkHash'=>'ls',
'maxButtonCount' => 5,
'firstPageLabel' => '',
'prevPageLabel' => '',
'nextPageLabel' => '',
'lastPageLabel' => 'last',
'header' => '<p>Page:</p>',
/*'pager'=>array(
'class'=>'MyLinkPager',
'linkHash'=>'test'
),*/
'htmlOptions' => array(
'class' => 'pages'
)
)); ?>
Try this
<?php
$this->widget('CLinkPager', array(
'currentPage' => $pages->getCurrentPage(),
'itemCount' => $item_count,
'pageSize' => $page_size,
//'linkHash'=>'ls',
'maxButtonCount' => 5,
'selectedPageCssClass'=>'active',
'hiddenPageCssClass'=>'disabled',
'firstPageCssClass'=>'previous',
'firstPageLabel' => '<< first | ',
'prevPageLabel' => 'previous |',
'nextPageLabel' => ' | next',
'lastPageLabel' => ' | last >>',
'header' => '<p>Page:</p>',
/*'pager'=>array(
'class'=>'MyLinkPager',
' linkHash'=>'test'
),*/
'htmlOptions' => array(
'class' => 'pages'
)
)); ?>
In this case you need to set a page labels.
You can use this instead of yout current definition:
'firstPageLabel' => '«« first',
'prevPageLabel' => '« previus',
'nextPageLabel'=>'next »',
'lastPageLabel'=>'last »»',
'maxButtonCount' => 5
To style a vertical separator you can use a css:
'cssFile' => Yii::app()->request->baseUrl . '/css/your_pager_css.css',
Place new css file to css dir and define a needed styles of a pager.
Some ideas: http://www.yiiplayground.com/index.php?r=UiModule/pagination/basicPager
How to customize Yii CGridView Pager?