Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Yiimongodbsuite And Dropdown Lists

$
0
0
does anybody know how to populate a dropdown list with a mongodb collection?

$list = CHtml::listData($industryModels, '_id', 'name');
echo $form->dropDownListRow($model, 'industry_id', $list);'


wont work because
_id
is a mongoId object and toString is not automatically called. i get the following error:

PHP warning Illegal offset type...which based on the stack-trace means an object cannot be used as an array key.

so how do i get the mongoId string to use as the key in the dropdown list???

Viewing all articles
Browse latest Browse all 18717

Trending Articles