Donnie Thomas
Donnie Thomas

Reputation: 4038

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?

Upvotes: 4

Views: 5084

Answers (1)

briiC
briiC

Reputation: 2134

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

Upvotes: 5

Related Questions