Yii framework Pagination Using CListView and CLinkPager

In this post i explained to implement the Yii framework Pagination Using CListView and CLinkPager. From my limited test, what I found is that by defining a custom pager ourselves, Yii will use the limit and offset when querying, correct me if I am wrong.

We can change the pager properties and make new look for pagination. I added the source code for following ClinkPager Properties:


1) Header Text
2) Previous Page Text
3) Next Page Text
4) First Page Text
5) Last Page Text
6) Footer Text
7) Display Number Of Button In Pagination
8) First Page Css Class
9) Last Page Css Class
10) Previous Page Css Class
11) Next Page Css Class
12) Internal Page Css Class
13) Selected Page Css Class
14) Hidden Page Css Class
15) Add Css file For Pagination
16) HTML Options

Pagination HTML Options

Pagination Label With Image

Add below code to add inline images for previous and next buttons.

Assign Image Using CSS

You can also add images for next & previous buttons by adding some css code. Copy paste below code to add inline images in pagging.

Pagination Labeled With Different Css

Css styles For Pagination code

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:

Article Tags: , , , , , ,