Yii framework Pagination Using CListView and CLinkPager

Prem Tiwari - - 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

Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer and a blogger by hobby.

Tags: , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.