protected function buildAttributes(array $attributes) { $html = []; foreach ($attributes as $key => $value) { $html[] = $key . '="' . $value . '"'; } return count($html) ? ' ' . implode(' ', $html) : ''; }