Commit 0ea7c2dd authored by Alexander Makarov's avatar Alexander Makarov

Merge pull request #18 from mikehaertl/7895-label-option

Fix issue 7895 (yii2): label option ignored
parents a163a130 2413f3f4
......@@ -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;
}
}
}
......@@ -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)
......
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