我想使用模型中的几个属性作为textField
. 像这样的东西:
$form->dropDownList(
$formModel,
'ref_attribute',
CHtml::listData(
User::model()->findAll(array('order'=>'attribute1 ASC, attribute2 ASC')),
'id',
'attribute1 attribute2 (attribute3)'),
array()
);
这样它'attribute1 attribute2 (attribute3)'
就会自动转换为正确的属性值。我已经尝试“按原样”编写它('attribute1 attribute2 (attribute3)'
),并在模型中创建一个中间函数(fullName()
),但似乎没有任何效果。
提前致谢。