This is a tutorial show you how to make yii pagination with CActiveDataProvider in Yii Framework. Let check it out !

In controllers, where data you want to set pagination but the following code:

'pagination' => array(
                 'pageSize' => 2,

With PageSize is the number of item per page.
So the full code of CActiveDataProvider will look like:

$dormProvider = new CActiveDataProvider('Dorm', array(
            'pagination' => array(
                    'pageSize' => 2,

In view, put this code in ClistView


ClistView will be look like

    $this->widget('zii.widgets.CListView', array(

Here you will see page toolbar

You also can change interface of paging menu by changing attribute of pager in ClistView.
    'header' =>'Test page',
    'selectedPageCssClass' => 'active',

So it will look like