php - Yii relations and findAllByAttributes -
in order find records given quantity have next code. giving me proper records shows 'id' of each record. how can display 'attributeb' instead of 'id' in results.
$qty = $model->relation->quantity; $item = modelb::model()->findallbyattributes(array('quantity'=>$qty)); echo $form->dropdownlist($model, 'attribute', $item);
try this
echo $form->dropdownlist($model,'attribute',chtml::listdata($item, 'id', 'attributeb')); php yii
No comments:
Post a Comment