Lavary\Menu\Builder::attributes PHP Method

attributes() public static method

Build an HTML attribute string from an array.
public static attributes ( array $attributes ) : string
$attributes array
return string
    public static function attributes($attributes)
    {
        $html = array();
        foreach ((array) $attributes as $key => $value) {
            $element = self::attributeElement($key, $value);
            if (!is_null($element)) {
                $html[] = $element;
            }
        }
        return count($html) > 0 ? ' ' . implode(' ', $html) : '';
    }