I have following code in action:
$criteria=new CDbCriteria(array(
'condition'=>'status='.Post::STATUS_PUBLISHED,
'order'=>'sortOrder ASC',
'with'=>'commentCount',
));
$criteria->addSearchCondition('tags','home');
$dataProvider=new CActiveDataProvider('Post', array(
'pagination'=>array(
'pageSize'=>Yii::app()->params['postsPerPageHome'],
),
'criteria'=>$criteria,
));
$this->render('home',array(
'dataProvider'=>$dataProvider,
));
home View:
<?php foreach($dataProvider->getData() as $post) { ?>
// ....... displaying $post values
<?php } ?>
How can I display the pagination in above view. I have searched for it, I found only using with zii.widgets.grid.CGridView but here I haven't use the widget.