public function attributes($attributes)
{
$html = array();
foreach ((array) $attributes as $key => $value) {
// For numeric keys, we will assume that the key and the value are the
// same, as this will convert HTML attributes such as "required" that
// may be specified as required="required", etc.
if (is_numeric($key)) {
$key = $value;
}
if (!is_null($value)) {
$html[] = $key . '="' . $this->entities($value) . '"';
}
}
return count($html) > 0 ? ' ' . implode(' ', $html) : '';
}