private function generateTagAttributes(): string
    {
        // When no attributes present, return empty string
        if (count($this->getAttributes()) === 0) {
            return '';
        }

        // Collect the attributes
        $renderedAttributes = [];
        foreach ($this->getAttributes() as $attribute => $value) {
            // Attributes can have a value or not, it just present (i.e. checked)
            $renderedAttributes[] = $this->generateAttribute($attribute, $value);
        }

        // Join the attributes with a space
        return implode(' ', $renderedAttributes);
    }
private function generateTagAttributes(): string
    {
        // When no attributes present, return empty string
        if (count($this->getAttributes()) === 0) {
            return '';
        }

        // Collect the attributes
        $renderedAttributes = [];
        foreach ($this->getAttributes() as $attribute => $value) {
            // Attributes can have a value or not, it just present (i.e. checked)
            $renderedAttributes[] = $this->generateAttribute($attribute, $value);
        }

        // Join the attributes with a space
        return implode(' ', $renderedAttributes);
    }
private function generateTagAttributes ( ) : string { // When no attributes present, return empty string if ( count ( $ this -> getAttributes ( ) ) === 0 ) { return '' ; } // Collect the attributes $ renderedAttributes = [ ] ; foreach ( $ this -> getAttributes ( ) as $ attribute => $ value ) { // Attributes can have a value or not, it just present (i.e. checked) $ renderedAttributes [ ] = $ this -> generateAttribute ( $ attribute , $ value ) ; } // Join the attributes with a space return implode ( ' ' , $ renderedAttributes ) ; }
Generates the HTML for the attributes of the HTML element.
@return string
Generates the HTML for the attributes of the HTML element .