Commit b1d673ad authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Dans le ViewHelper FormControlGroup, la méthode normalizeElement écrasait les labelAttributes

parent fe4cfd6d
Pipeline #5134 failed with stage
in 9 seconds
......@@ -140,10 +140,11 @@ class FormControlGroup extends AbstractHelper
{
if (!$element instanceof Button && !$element instanceof Checkbox) {
$class = $element->getAttribute('class');
$element->setAttribute('class', $class . ' form-control');
$labelClass = array_key_exists('class', $tmp = (array)$element->getLabelAttributes()) ? $tmp['class'] : '';
$element
->setAttribute('class', $class . ' form-control')
->setLabelAttributes(['class' => $labelClass . ' control-label']);
$labelAttributes = array_merge($element->getLabelAttributes(), ['class' => $labelClass . ' control-label']);
$element->setLabelAttributes($labelAttributes);
}
}
......
Supports Markdown
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