private function buildLabel($title, $for, $required = false)
    {
        // Create label
        $label = $this->formLabel($title, $for);

        if (!empty($title)) {
            // Set Required indicator
            if ($required) {
                $star = $this->requiredStar();
                $label->append($star);
            }

            $colonSpan = $this->getHTMLDocument()->getHTMLFactory()->buildElement('span', ':');
            $label->append($colonSpan);
        }

        return $label;
    }
private function buildLabel($title, $for, $required = false)
    {
        // Create label
        $label = $this->formLabel($title, $for);

        if (!empty($title)) {
            // Set Required indicator
            if ($required) {
                $star = $this->requiredStar();
                $label->append($star);
            }

            $colonSpan = $this->getHTMLDocument()->getHTMLFactory()->buildElement('span', ':');
            $label->append($colonSpan);
        }

        return $label;
    }
private function buildLabel ( $ title , $ for , $ required = false ) { // Create label $ label = $ this -> formLabel ( $ title , $ for ) ; if ( ! empty ( $ title ) ) { // Set Required indicator if ( $ required ) { $ star = $ this -> requiredStar ( ) ; $ label -> append ( $ star ) ; } $ colonSpan = $ this -> getHTMLDocument ( ) -> getHTMLFactory ( ) -> buildElement ( 'span' , ':' ) ; $ label -> append ( $ colonSpan ) ; } return $ label ; }
Builds and returns a simple form label.

@param string $title
@param string $for
@param bool   $required

@return HTMLElement
@throws InvalidArgumentException
Builds and returns a simple form label .