Commit 309415f1 authored by Qiang Xue's avatar Qiang Xue

Fixes #3910: Removed the `container` option from `Html::checkbox()` and `Html::radio()`

parent 0bdbf0d9
...@@ -248,10 +248,13 @@ class ActiveField extends \yii\widgets\ActiveField ...@@ -248,10 +248,13 @@ class ActiveField extends \yii\widgets\ActiveField
} }
if (!isset($options['itemOptions'])) { if (!isset($options['itemOptions'])) {
$options['itemOptions'] = [ $options['itemOptions'] = [
'container' => false,
'labelOptions' => ['class' => 'checkbox-inline'], 'labelOptions' => ['class' => 'checkbox-inline'],
]; ];
} }
} elseif (!isset($options['item'])) {
$options['item'] = function ($index, $label, $name, $checked, $value) {
return '<div class="checkbox">' . Html::checkbox($name, $checked, ['label' => $label, 'value' => $value]) . '</div>';
};
} }
parent::checkboxList($items, $options); parent::checkboxList($items, $options);
return $this; return $this;
...@@ -271,10 +274,13 @@ class ActiveField extends \yii\widgets\ActiveField ...@@ -271,10 +274,13 @@ class ActiveField extends \yii\widgets\ActiveField
} }
if (!isset($options['itemOptions'])) { if (!isset($options['itemOptions'])) {
$options['itemOptions'] = [ $options['itemOptions'] = [
'container' => false,
'labelOptions' => ['class' => 'radio-inline'], 'labelOptions' => ['class' => 'radio-inline'],
]; ];
} }
} elseif (!isset($options['item'])) {
$options['item'] = function ($index, $label, $name, $checked, $value) {
return '<div class="radio">' . Html::radio($name, $checked, ['label' => $label, 'value' => $value]) . '</div>';
};
} }
parent::radioList($items, $options); parent::radioList($items, $options);
return $this; return $this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment