Fixes #16629: ActiveField::inputOptions were not merged with options passed for radio and checkbox

This commit is contained in:
Paweł Jankowiak
2018-11-19 23:12:17 +01:00
committed by Alexander Makarov
parent 06227c7075
commit 8334ab3060
3 changed files with 83 additions and 1 deletions

View File

@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.16 under development
------------------------
- Bug #16629: ActiveField::inputOptions were not merged with options passed for radio and checkbox (paweljankowiak06)
- Bug #16648: Html::strtolower() was corrupting UTF-8 strings (Kolyunya)
- Bug #13977: Skip validation if file input does not exist (RobinKamps, s1lver)
- Bug #16183: Fixed when `yii\helpers\BaseFileHelper` sometimes returned wrong value (samdark, SilverFire, OndrejVasicek)

View File

@ -542,6 +542,8 @@ class ActiveField extends Component
*/
public function radio($options = [], $enclosedByLabel = true)
{
$options = array_merge($this->inputOptions, $options);
if ($enclosedByLabel) {
$this->parts['{input}'] = Html::activeRadio($this->model, $this->attribute, $options);
$this->parts['{label}'] = '';
@ -594,6 +596,8 @@ class ActiveField extends Component
*/
public function checkbox($options = [], $enclosedByLabel = true)
{
$options = array_merge($this->inputOptions, $options);
if ($enclosedByLabel) {
$this->parts['{input}'] = Html::activeCheckbox($this->model, $this->attribute, $options);
$this->parts['{label}'] = '';