public function getAttributesString(array $skip = []): string
    {
        $skip = array_map('strtolower', $skip);

        $res = [];

        // Id can be set
        if ($this->id) {
            $res[] = 'id="' . htmlspecialchars((string)$this->getId(), ENT_QUOTES) . '"';
        }

        foreach ($this->attributes as $k => $v) {
            // Skip if needed
            if (in_array($k, $skip, true)) {
                continue;
            }

            switch ($k) {
                case 'disabled':
                case 'selected':
                case 'checked':

                    if (!$v) {
                        continue 2;
                    }

                    $v = $k;
                    break;

                case 'value':

                    $v = htmlspecialchars((string)$v, ENT_QUOTES);
                    break;

            }

            // If attribute itself is array of attributes
            if (is_array($v)) {
                $v = implode('', $v);
            }

            $res[] = $k . '="' . $v . '"';
        }

        return implode(' ', $res);
    }
public function getAttributesString(array $skip = []): string
    {
        $skip = array_map('strtolower', $skip);

        $res = [];

        // Id can be set
        if ($this->id) {
            $res[] = 'id="' . htmlspecialchars((string)$this->getId(), ENT_QUOTES) . '"';
        }

        foreach ($this->attributes as $k => $v) {
            // Skip if needed
            if (in_array($k, $skip, true)) {
                continue;
            }

            switch ($k) {
                case 'disabled':
                case 'selected':
                case 'checked':

                    if (!$v) {
                        continue 2;
                    }

                    $v = $k;
                    break;

                case 'value':

                    $v = htmlspecialchars((string)$v, ENT_QUOTES);
                    break;

            }

            // If attribute itself is array of attributes
            if (is_array($v)) {
                $v = implode('', $v);
            }

            $res[] = $k . '="' . $v . '"';
        }

        return implode(' ', $res);
    }
public function getAttributesString ( array $ skip = [ ] ) : string { $ skip = array_map ( 'strtolower' , $ skip ) ; $ res = [ ] ; // Id can be set if ( $ this -> id ) { $ res [ ] = 'id="' . htmlspecialchars ( ( string ) $ this -> getId ( ) , ENT_QUOTES ) . '"' ; } foreach ( $ this -> attributes as $ k => $ v ) { // Skip if needed if ( in_array ( $ k , $ skip , true ) ) { continue ; } switch ( $ k ) { case 'disabled' : case 'selected' : case 'checked' : if ( ! $ v ) { continue 2 ; } $ v = $ k ; break ; case 'value' : $ v = htmlspecialchars ( ( string ) $ v , ENT_QUOTES ) ; break ; } // If attribute itself is array of attributes if ( is_array ( $ v ) ) { $ v = implode ( '' , $ v ) ; } $ res [ ] = $ k . '="' . $ v . '"' ; } return implode ( ' ' , $ res ) ; }
Return string consisting from all html element attributes

@param array $skip

@return string
Return string consisting from all html element attributes