I'd like to use a couple of attributes from within a model as textField
. Something like this:
$form->dropDownList(
$formModel,
'ref_attribute',
CHtml::listData(
User::model()->findAll(array('order'=>'attribute1 ASC, attribute2 ASC')),
'id',
'attribute1 attribute2 (attribute3)'),
array()
);
so that 'attribute1 attribute2 (attribute3)'
is automatically translated into the correct attribute values. I have tried writing it "as is" ('attribute1 attribute2 (attribute3)'
), and creating a middle function inside the model (fullName()
), but nothing seemed to work.
Thanks in advance.