I'm trying to use an activeCheckboxlist in a form in my Yii 开发者_开发知识库site. When generating the checkboxlist, Yii automatically puts a < br > between the checkboxes.
Is there any way to avoid/override this except with CSS?
Yes, you can do that by give 'separator' param in htmlOptions
echo CHtml::activeCheckboxList($model, $attribute, $dataArr,
array(
//..
'separator'=>'|', //new separator. html allowed also
//'template'=>'<span class="myItem">{label} {input}</span>', // use template to customize each item
//..
));
http://www.yiiframework.com/doc/api/1.1/CHtml#activeCheckBoxList-detail
精彩评论