Yii framework Pagination Using CListView and CLinkPager

| Last Updated: | In: Yii framework


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


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


You may also like:


, , , , , ,