Hi my friend if I got your question this is what you’re asking for
//On the model
public function toList()
{
$model = Department::model()->findAll('');
return CHtml::listData($model, 'CodDepartment', 'CodDepartment'." | ".'DescDepartment');
}
//On the form
<?php echo $form->dropDownList($model,'CodDepartment', Department::toList(), array('empty'=>'Select a value...')); ?>
Good luck bro, if this is not what you need tell us and we’ll try to help you