Contao\Widget::generateLabel PHP Method

generateLabel() public method

Generate the label and return it as string
public generateLabel ( ) : string
return string The label markup
    public function generateLabel()
    {
        if ($this->strLabel == '') {
            return '';
        }
        return sprintf('<label%s%s>%s%s%s</label>', $this->blnForAttribute ? ' for="ctrl_' . $this->strId . '"' : '', $this->strClass != '' ? ' class="' . $this->strClass . '"' : '', $this->mandatory ? '<span class="invisible">' . $GLOBALS['TL_LANG']['MSC']['mandatory'] . ' </span>' : '', $this->strLabel, $this->mandatory ? '<span class="mandatory">*</span>' : '');
    }