[英]Yii2: How to make inline radioList with HtmlHelpers
I have this radioList: 我有这个radioList:
Html::radioList('name,null,$array['class' => 'form-control']);
It genegated vertical radioList, but I want it horizontal. 它产生了垂直的radioList,但我希望它是水平的。
<?=Html::activeRadioList($model, $attribute, [1 => 'option1', 2 => 'option2'], [
'item' => function ($index, $label, $name, $checked, $value) {
return '<label class="radio-inline">' . Html::radio($name, $checked, ['value' => $value]) . $label . '</label>';
}
])?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.