';
$html .= '';
$selected = explode(',', $element->getValue());
foreach ($selected as $value) {
if ($key = array_search($value, array_column($values, 'value'))) {
$html .= '- ';
$html .= isset($values[$key]['label'])?$values[$key]['label']:'n/a';
$html .= '
';
$values[$key]['selected'] = TRUE;
}
}
$html .= ' | ';
$html .= '';
if ($values) {
foreach ($values as $option) {
if (!isset($option['selected'])) {
$html .= '- ';
$html .= isset($option['label'])?$option['label']:'n/a';
$html .= '
';
}
}
}
$html .= ' |