How to determine ODD elements inside CListView items


I am using CListView widget:

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

			'dataProvider' => $hotEstatesProvider,

			'itemView'     => 'index-hot-estate-list-item',

			'htmlOptions'  => array('class' => 'hotAdvertSmall')

		)); ?>

and i want to set different classes per each odd item. How can i determine them inside index-hot-estate-list-item.php file?

Inside file ‘$this’ refers to controller so i could not get any info about current item and widget.


($index % 2) ? odd : even

Read more here.

(not tested)


Thanks! Have not seen this variables before.