Commit c4ff009e by Alexander Makarov

Merge pull request #1798 from zhuravljov/patch-1

Fixed label attributes in BaseHtml
parents 4bbd844b 2daa5e91
...@@ -961,9 +961,9 @@ class BaseHtml ...@@ -961,9 +961,9 @@ class BaseHtml
*/ */
public static function activeLabel($model, $attribute, $options = []) public static function activeLabel($model, $attribute, $options = [])
{ {
$for = array_key_exists('for', $options) ? $options['for'] : static::getInputId($model, $attribute);
$attribute = static::getAttributeName($attribute); $attribute = static::getAttributeName($attribute);
$label = isset($options['label']) ? $options['label'] : static::encode($model->getAttributeLabel($attribute)); $label = isset($options['label']) ? $options['label'] : static::encode($model->getAttributeLabel($attribute));
$for = array_key_exists('for', $options) ? $options['for'] : static::getInputId($model, $attribute);
unset($options['label'], $options['for']); unset($options['label'], $options['for']);
return static::label($label, $for, $options); return static::label($label, $for, $options);
} }
......
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