Hi everyone:)
At this moment I’m puzzled about something. In a form, I’m trying to display two databasefields as one textfield. These fields are retrieved correctly, but how can I chain them so they will display as one field in the dropdownlist?
Here’s the line of code I currently have:
<?php echo $form->dropDownlist($model,'machine_id',
CHtml::listData(Machine::model()->
with('merk')->
findAll(array('order'=>'merk.naam ASC')),
'machine_id', 'merk.naam naam'),
array('empty'=>'selecteer machine'));
?>
Obviously, a string like ‘merk.naam naam’ doesn’t work. Is there a way to display this correctly or should I solve this at model-level where the relation between the two tables is defined?
Thanks in advance,
regards,