Yii drop down - attributes to option tag

I want to create a drop down with id attribute to the option tag. How do I achieve this ? I want the id to be of the same value as the value attribute

Following is my code for creating the drop.

<?php echo CHtml::activeDropDownList($params, ‘location’, CHtml::listData(Location::model()->findAll(), ‘id’, ‘name’)) ;?>

Any help ??

You should be able to figure this out from the following:


Look in particular at the listOptions link.