public function htmlAttributes($attributes)
{
$result = '';
$attributes = (array) $attributes;
if (count($attributes)) {
foreach ($attributes as $key => $param) {
$value = implode(' ', (array) $param);
$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
$value = trim($value);
$result .= ' ' . $key . '="' . $value . '"';
}
}
return trim($result);
}