Get_Class() Expects Parameter 1 To Be Object, Array Given For Listdata()

Hi,

I’m using this code to try and populate a drop down box.




<?php echo $form->dropDownList($model, 'name', CHtml::listData(User::model()->findAll(), 'id', 'name')); ?>



But I’m getting the follow error. get_class() expects parameter 1 to be object, array given

I can see in my stack that the data is being provided ok, so not sure what I’ve done wrong here?

Any help is appreciated

Jonny

these links might help you

http://www.yiiframework.com/forum/index.php/topic/23210-dropdownlist-data/

others: