getting related data into a dropdownlist

Hello everyone,

i have the following tables,

Animals:

id

kind_id

name

Kinds:

id

name

I just managed to get the related data into a view, but now im facing the next problem.

I have created a crud application to add animals and now im edditing the created data, i have changed the active form textField to an dropDownList, and im using CHtml::listData().

<?php echo $form->dropDownList($model,‘soort_id’,CHtml::listData(Animals::model()->findAll(),‘kind_id’,‘kind’)) ;?>

but istead im getting the kinds->name im getting the kind_id integer, i have tried several options and i keep getting errors, can someone help me please.

Thanks in advance.

Edit: Solved, i was stupid enough to use the wrong model… i used the animal model and tried to acces the kinds fields though animals instead of using the kinds model :wacko:

im still learning :D