/** * @return string attributes */ function htmlattributes(array $extra = array()) { $attr_segments = array(); $attributes = pixcustomify::merge($this->attrs->metadata_array(), $extra); foreach ($attributes as $key => $value) { if ($value !== false && $value !== null) { if (!empty($value)) { if (is_array($value)) { $htmlvalue = implode(' ', $value); $attr_segments[] = "{$key}=\"{$htmlvalue}\""; } else { // value is not an array $attr_segments[] = "{$key}=\"{$value}\""; } } else { // empty html tag; ie. no value html tag $attr_segments[] = $key; } } } return implode(' ', $attr_segments); }