Browse Source

fixed issue with wrongly assigned label in bootstrap

fixes #5984
tags/2.0.4
Carsten Brandt 10 years ago
parent
commit
a78d8b59b2
  1. 3
      ActiveField.php
  2. 2
      CHANGELOG.md

3
ActiveField.php

@ -376,6 +376,9 @@ class ActiveField extends \yii\widgets\ActiveField
$label = Html::encode($this->model->getAttributeLabel($attribute)); $label = Html::encode($this->model->getAttributeLabel($attribute));
} }
} }
if (!isset($options['for'])) {
$options['for'] = Html::getInputId($this->model, $this->attribute);
}
$this->parts['{beginLabel}'] = Html::beginTag('label', $options); $this->parts['{beginLabel}'] = Html::beginTag('label', $options);
$this->parts['{endLabel}'] = Html::endTag('label'); $this->parts['{endLabel}'] = Html::endTag('label');
$this->parts['{labelTitle}'] = $label; $this->parts['{labelTitle}'] = $label;

2
CHANGELOG.md

@ -4,7 +4,7 @@ Yii Framework 2 bootstrap extension Change Log
2.0.4 under development 2.0.4 under development
----------------------- -----------------------
- no changes in this release. - Bug #5984: `yii\bootstrap\Activefield::checkbox()` caused browser to link label to the wrong input (cebe)
2.0.3 March 01, 2015 2.0.3 March 01, 2015

Loading…
Cancel
Save