I’m trying to make a radiobutton list but the result is not what I want.
This is the code in my view:
<?php
$model_type = RatingServiceType::model()->findAll();
foreach ($model_type as $m) {
echo '<div class="row newitems">'.'<b>'.$m->name.'</b>';
echo '</br></br>';
$model_question = RatingServiceQuestion::model()->findAll('id_rating_service_type='.$m->id);
foreach ($model_question as $m2){
echo '<div style="padding-left:0px">';
echo '<div style="">'.$m2->name.'</div>';
echo $form->radioButtonList($model, 'id_rating_service_question',
array(
1=>'aaa',
2=>'bbb',
3=>'ccc',
4=>'ddd'
),
//array(1=>'Insufficient',2=>'Sufficient',3=>'Good',4=>'Very Good'),
array(
'labelOptions'=>array('style'=>'display:inline'),
'separator'=>' ',
'template'=>'<div>{label}</div></br><div>{input}</div>',
//'template'=>"<tr>{input}</tr><tr>{label}</tr>",
)
);
//echo $form->checkBox($model, 'status');
echo '</div>';
}
echo '</div>';
} ?>
What I see is:
aaa bbb ccc ddd ()()()()
What I want is:
aaa bbb ccc ddd
() () () ()
What am I’m doing wrong? I’ve tried in both Firefox and IE, and is the same result.
I used those divs to gief a result like this:
aaa bbb ccc ddd
() () () ()
So I can center the text with CSS later. The problem is I can’t make it to work