I currently have a radio button list with a template but I would like to display an additional attribute other than the button and the value.
My code:
<div class="row">
<?php echo $form->labelEx($model,'recordId'); ?>
<?php
echo '<table><tr>';
echo CHtml::activeRadioButtonList($model,'recordId',
CHtml::listData(Record::model()->findAll(), 'id', 'name'),
array(
'separator'=>'',
'template'=>'<td><table><tr><td>{label}</td></tr><tr><td>{input}</td></tr></table></td>',
'labelOptions'=>array('style'=>'display:inline')
));
echo '</tr></table>';
?>
<?php echo $form->error($model,'recordId'); ?>
</div>
How do I access the data returned by the listData to add another row into the template and display a value?
<div class="row">
<?php echo $form->labelEx($model,'recordId'); ?>
<?php
echo '<table><tr>';
echo CHtml::activeRadioButtonList($model,'recordId',
CHtml::listData(Record::model()->findAll(), 'id', 'name'),
array(
'separator'=>'',
'template'=>'<td><table><tr><td>{label}</td></tr><tr><td> record value here</td></tr><tr><td>{input}</td></tr></table></td>',
'labelOptions'=>array('style'=>'display:inline')
));
echo '</tr></table>';
?>
<?php echo $form->error($model,'recordId'); ?>
</div>
Would this be done by extending the radio button or the listData or?
Thanks,