Contao\CheckBox::generateCheckbox PHP Method

generateCheckbox() protected method

Generate a checkbox and return it as string
protected generateCheckbox ( array $arrOption, integer $i ) : string
$arrOption array
$i integer
return string
    protected function generateCheckbox($arrOption, $i)
    {
        return sprintf('<input type="checkbox" name="%s" id="opt_%s" class="tl_checkbox" value="%s"%s%s onfocus="Backend.getScrollOffset()"> <label for="opt_%s">%s%s%s</label>', $this->strName . ($this->multiple ? '[]' : ''), $this->strId . '_' . $i, $this->multiple ? \StringUtil::specialchars($arrOption['value']) : 1, $this->isChecked($arrOption), $this->getAttributes(), $this->strId . '_' . $i, $this->mandatory && !$this->multiple ? '<span class="invisible">' . $GLOBALS['TL_LANG']['MSC']['mandatory'] . ' </span>' : '', $arrOption['label'], $this->mandatory && !$this->multiple ? '<span class="mandatory">*</span>' : '');
    }