Numbering Clistview Results

Is there an easy way to number each record and label each with like 1, 2, 3 or better yet 1st, 2nd, or 3rd generated by ClistView. Here is my ClistView

$this->widget('zii.widgets.CListView', array(



                            'emptyText'=>'There are no clients  waiting in line',


                            'summaryText'=>'There are {count} clients waiting in line',


Dear Friend

We can do something like this.


<?php $this->widget('zii.widgets.CListView', array(




)); ?>





div class="view">


	<?php echo CHtml::encode($itemNumber); ?>

	<br />

<!-- below all the routine attributes -->

	<b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b>

	<?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>

	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('name')); ?>:</b>

	<?php echo CHtml::encode($data->name); ?>

	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('mark')); ?>:</b>

	<?php echo CHtml::encode($data->mark); ?>

	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('rank')); ?>:</b>

	<?php echo CHtml::encode($data->rank); ?>

	<br />


We can also calculate itemNumber in the following way.


//$index is provided by the dataprovider for current item.


Yesss! Thanks!