diff --git a/ActiveField.php b/ActiveField.php index 2f72b28..3181a6c 100644 --- a/ActiveField.php +++ b/ActiveField.php @@ -201,6 +201,9 @@ class ActiveField extends \yii\widgets\ActiveField $this->template = $options['template']; unset($options['template']); } + if (isset($options['label'])) { + $this->parts['{labelTitle}'] = $options['label']; + } if ($this->form->layout === 'horizontal') { Html::addCssClass($this->wrapperOptions, $this->horizontalCssClasses['offset']); } @@ -223,6 +226,9 @@ class ActiveField extends \yii\widgets\ActiveField $this->template = $options['template']; unset($options['template']); } + if (isset($options['label'])) { + $this->parts['{labelTitle}'] = $options['label']; + } if ($this->form->layout === 'horizontal') { Html::addCssClass($this->wrapperOptions, $this->horizontalCssClasses['offset']); } @@ -381,6 +387,8 @@ class ActiveField extends \yii\widgets\ActiveField } $this->parts['{beginLabel}'] = Html::beginTag('label', $options); $this->parts['{endLabel}'] = Html::endTag('label'); - $this->parts['{labelTitle}'] = $label; + if (!isset($this->parts['{labelTitle}'])) { + $this->parts['{labelTitle}'] = $label; + } } } diff --git a/CHANGELOG.md b/CHANGELOG.md index 3532d7a..569d6ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Yii Framework 2 bootstrap extension Change Log 2.0.4 under development ----------------------- +- Bug #18: `label` option ignored by `yii\bootstrap\Activefield::checkbox()` and `yii\bootstrap\Activefield::radio()` (mikehaertl) - Bug #5984: `yii\bootstrap\Activefield::checkbox()` caused browser to link label to the wrong input (cebe) - Enh #7633: Added `ActionColumn::$buttonOptions` for defining HTML options to be added to the default buttons (cebe) - Enh: Added `Nav::$dropDownCaret` to allow customization of the dropdown caret symbol (cebe)