Normally when i generate any CRUD by gii in Yii, its just shows the text fields. If any one want to change it to drop down list, and want to fetch data from another table, then we have to do this:
<?php echo $form->dropDownList($model,’user_type_id’,
CHtml::listData(UserType::model()->findAll(), ‘id’, ‘type’),
$form->dropDownList is a widget.
UserType is a model.
CHtml::listData is a function which will genarate a select list from model data.
Here in listData function 2nd parameter is $valueField and 3rd parameter is $textField, which are equivalent to HTMLselect options value and name.