mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 22:32:40 +08:00
Fixes #14230: Fixed itemsOptions ignored in checkBoxList
This commit is contained in:
committed by
Alexander Makarov
parent
421bd96e99
commit
a8bfe8bbe6
@ -4,6 +4,7 @@ Yii Framework 2 Change Log
|
|||||||
2.0.16 under development
|
2.0.16 under development
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
|
- Bug #14230: Fixed `itemsOptions` ignored in `checkBoxList` (s1lver)
|
||||||
- Bug #14368: Added `role` attribute for active radio list (s1lver)
|
- Bug #14368: Added `role` attribute for active radio list (s1lver)
|
||||||
- Bug #16680: Fixed ActiveField 'text' input with maxlength (s1lver)
|
- Bug #16680: Fixed ActiveField 'text' input with maxlength (s1lver)
|
||||||
- Bug #5341: HasMany via two relations (shirase, cebe)
|
- Bug #5341: HasMany via two relations (shirase, cebe)
|
||||||
|
|||||||
@ -958,10 +958,10 @@ class BaseHtml
|
|||||||
if ($formatter !== null) {
|
if ($formatter !== null) {
|
||||||
$lines[] = call_user_func($formatter, $index, $label, $name, $checked, $value);
|
$lines[] = call_user_func($formatter, $index, $label, $name, $checked, $value);
|
||||||
} else {
|
} else {
|
||||||
$lines[] = static::checkbox($name, $checked, array_merge($itemOptions, [
|
$lines[] = static::checkbox($name, $checked, array_merge([
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
'label' => $encode ? static::encode($label) : $label,
|
'label' => $encode ? static::encode($label) : $label,
|
||||||
]));
|
], $itemOptions));
|
||||||
}
|
}
|
||||||
$index++;
|
$index++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -714,6 +714,17 @@ EOD;
|
|||||||
EOD;
|
EOD;
|
||||||
$this->assertEqualsWithoutLE($expected, Html::checkboxList('test', ['1', 'value3'], $this->getDataItems3()));
|
$this->assertEqualsWithoutLE($expected, Html::checkboxList('test', ['1', 'value3'], $this->getDataItems3()));
|
||||||
$this->assertEqualsWithoutLE($expected, Html::checkboxList('test', new \ArrayObject(['1', 'value3']), $this->getDataItems3()));
|
$this->assertEqualsWithoutLE($expected, Html::checkboxList('test', new \ArrayObject(['1', 'value3']), $this->getDataItems3()));
|
||||||
|
|
||||||
|
$expected = <<<'EOD'
|
||||||
|
<div><label><input type="checkbox" name="test[]" value="0"> Test Label</label>
|
||||||
|
<label><input type="checkbox" name="test[]" value="0"> Test Label</label></div>
|
||||||
|
EOD;
|
||||||
|
$this->assertEqualsWithoutLE($expected, Html::checkboxList('test', null, $this->getDataItems(), [
|
||||||
|
'itemOptions' => [
|
||||||
|
'value' => 0,
|
||||||
|
'label' => 'Test Label'
|
||||||
|
]
|
||||||
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRadioList()
|
public function testRadioList()
|
||||||
|
|||||||
Reference in New Issue
Block a user