get CListView page number inside itemView

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:

here is how i solved this:

set ‘ajaxUpdate’=>false, to CListView

in _viewComment.php:


<?php

$pagination = $widget->dataProvider->pagination;

$offset = $pagination->pageSize * $pagination->currentPage;

$realIndex = $offset + $index;

$count = $pagination->itemCount;

?>


<div class="view">

/* some code that uses CListView page number */

</div>

Is there a better way?