Reputation: 841
In order to find all records with a given quantity I have the following code. This is giving me the proper records back but it only shows the 'id' of each record. How can I display 'AttributeB' instead of 'id' in my results.
$qty = $model->relation->Quantity;
$item = ModelB::model()->findAllByAttributes(array('Quantity'=>$qty));
echo $form->dropDownList($model, 'Attribute', $item);
Upvotes: 0
Views: 2144
Reputation: 1181
try this
echo $form->dropDownList($model,'Attribute',CHtml::listData($item, 'id', 'attributeB'));
Upvotes: 2