Reputation: 2600
How to show the pagination in the view, with own design, using dataProvider
?
Im not using CGridView
to show dataProvider
items.
Controller.php:
public function actionIndex()
{
$dataProvider=new CActiveDataProvider('Projects', array(
'criteria'=>array(
),
'pagination'=>array(
'pageSize'=>Yii::app()->params['itemsPerPage'],
),
));
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
}
Upvotes: 0
Views: 752
Reputation: 4114
You can use either ClinkPager
or CListPager
render a pager. Below is an example using CLinkPager
$this->widget('ClinkPager',array('pages'=>new CPagination(100)));
Upvotes: 1
Reputation: 571
All the CGridView, CListView and .. use a widget called, CLinkPager
It also gives good example in the comments about using it in controller and comment. I'm sure you can easily adopt your dataprovider to CLinkPager. Good luck. Read the public properties, you can even use your own CSS, for different pages.
Upvotes: 3