FOF30\Form\Field\Checkboxes::getFieldContents PHP Method

getFieldContents() public method

Method to get the field input markup.
public getFieldContents ( array $fieldOptions = [] ) : string
$fieldOptions array Options to be passed into the field
return string The field HTML
    public function getFieldContents(array $fieldOptions = array())
    {
        $id = isset($fieldOptions['id']) ? 'id="' . $fieldOptions['id'] . '" ' : '';
        $class = $this->class . (isset($fieldOptions['class']) ? ' ' . $fieldOptions['class'] : '');
        $translate = StringHelper::toBool($this->element['translate']) ? true : false;
        $html = '<span ' . ($id ? $id : '') . 'class="' . $class . '">';
        foreach ($this->value as $value) {
            $html .= '<span>';
            if ($translate == true) {
                $html .= JText::_($value);
            } else {
                $html .= $value;
            }
            $html .= '</span>';
        }
        $html .= '</span>';
        return $html;
    }