private static function buildAttributes($htmlAttributes, $ignore = array())
    {
        if (empty($htmlAttributes))
        {
            return '';
        }

        if ($ignore === null) {
            $ignore = array();
        }

        $filtered = array_filter($htmlAttributes, function($key) use ($ignore) {
            return !in_array($key, $ignore);
        }, \ARRAY_FILTER_USE_KEY);

        array_walk($filtered, function(&$value, $key) {
            $value = sprintf('%s="%s"', $key, self::encodeHtmlAttributeString($value));
        });

        return implode(' ', $filtered);
    }
private static function buildAttributes($htmlAttributes, $ignore = array())
    {
        if (empty($htmlAttributes))
        {
            return '';
        }

        if ($ignore === null) {
            $ignore = array();
        }

        $filtered = array_filter($htmlAttributes, function($key) use ($ignore) {
            return !in_array($key, $ignore);
        }, \ARRAY_FILTER_USE_KEY);

        array_walk($filtered, function(&$value, $key) {
            $value = sprintf('%s="%s"', $key, self::encodeHtmlAttributeString($value));
        });

        return implode(' ', $filtered);
    }
private static function buildAttributes ( $ htmlAttributes , $ ignore = array ( ) ) { if ( empty ( $ htmlAttributes ) ) { return '' ; } if ( $ ignore === null ) { $ ignore = array ( ) ; } $ filtered = array_filter ( $ htmlAttributes , function ( $ key ) use ( $ ignore ) { return ! in_array ( $ key , $ ignore ) ; } , \ ARRAY_FILTER_USE_KEY ) ; array_walk ( $ filtered , function ( & $ value , $ key ) { $ value = sprintf ( '%s="%s"' , $ key , self :: encodeHtmlAttributeString ( $ value ) ) ; } ) ; return implode ( ' ' , $ filtered ) ; }
Generates HTML-attributes string.

@param array $htmlAttributes Associative array of attributes.
@param array $ignore List of attributes to ignore.

@return string
Generates HTML - attributes string .