Dima Knivets
Dima Knivets

Reputation: 2528

Pagination in Yii

I'm implementing a simple widget with pagination and am facing a little problem.

When I have a small number of items on a page, the pagination isn't generated, but everything is okay when I have a lot of items.

The question is: How can I force pagination to render, even if there is only one page with records?

Upvotes: 0

Views: 1604

Answers (1)

Eric Leroy
Eric Leroy

Reputation: 1836

You basically just specify a page size on your data provider / active record

 $model = new CArrayDataProvider( $dataRow, 
             array('pagination'=> array('pageSize'=>5) ));

Upvotes: 1

Related Questions