i need the subject.
I have CListView with paging enabled
public function actionView($id)
{
$model = $this->loadModel($id);
$commentDataProvider = new CActiveDataProvider(
'Comment',
array(
'criteria'=>array(
'condition'=>'topic_id=:topicId',
'params'=>array(
':topicId'=>$model->id
)
),
'pagination'=>array(
'pageSize'=>2
)
)
);
$this->render('view',array(
'model'=>$model,
'commentDataProvider'=>$commentDataProvider,
'topicId'=>$model->id
));
}
view.php:
<h1><?php echo $model->name; ?></h1>
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$commentDataProvider,
'itemView'=>'_viewComment',
'viewData'=>array('count'=>$commentDataProvider->totalItemCount)
)); ?>
viewComment.php: