开发者

Yii Framework: Horizontal activeCheckboxList?

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜