Skip to content
Snippets Groups Projects
Commit d1bbf588 authored by Michael Grosse's avatar Michael Grosse
Browse files

refactor: use existing and simpler method

parent 9c3fca6d
No related branches found
No related tags found
No related merge requests found
......@@ -88,9 +88,8 @@ class OptGroup extends Element {
foreach($this->options as $key => $val) {
$selected = ($key == $this->value) ? ' selected="selected"' : '';
$attrs = '';
if (is_array($val['attrs'])) {
array_walk($val['attrs'],function (&$aval, $akey){$aval = hsc($akey).'="'.hsc($aval).'"';});
$attrs = join(' ', $val['attrs']);
if (!empty($val['attrs']) && is_array($val['attrs'])) {
$attrs = buildAttributes($val['attrs']);
}
$html .= '<option' . $selected . ' value="' . hsc($key) . '" '.$attrs.'>' . hsc($val['label']) . '</option>';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment