Search code examples
yiirecordscgridview

Yii CGridView showing more than 10 records per page


So here I've got a table which has more than 10 records.

In each admin.php page, the CGridView only shows a limited 10 records then to the next page. How or where should I add in order for it to display more than 10 records per page?

Please advise. Thanks in advance! :)


Solution

  • All you need to do is just modifying $model->search() in this way:

     ...
     return new CActiveDataProvider($this, array(
            'pagination' => array(
                'pageSize' => 20,
            ),