public function render()
    {

        $attr = [];

        foreach($this->attributes as $k => $v) {
            $attr[] = sprintf('%s="%s"', $k, $v);
        }

        return sprintf('<label %s>%s</label>',
            implode(' ', $attr),
            trim($this->labelText)
        );

    }
public function render()
    {

        $attr = [];

        foreach($this->attributes as $k => $v) {
            $attr[] = sprintf('%s="%s"', $k, $v);
        }

        return sprintf('<label %s>%s</label>',
            implode(' ', $attr),
            trim($this->labelText)
        );

    }
public function render ( ) { $ attr = [ ] ; foreach ( $ this -> attributes as $ k => $ v ) { $ attr [ ] = sprintf ( '%s="%s"' , $ k , $ v ) ; } return sprintf ( '<label %s>%s</label>' , implode ( ' ' , $ attr ) , trim ( $ this -> labelText ) ) ; }
render the label element
if a form element was assigned a
matching "for" attribute can be generated

@return string
render the label element if a form element was assigned a matching for attribute can be generated