FOF30\Form\Field\Timezone::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']) ? $fieldOptions['id'] : null;
        $class = $this->class . (isset($fieldOptions['class']) ? ' ' . $fieldOptions['class'] : '');
        $selected = GroupedList::getOptionName($this->getGroups(), $this->value);
        if (is_null($selected)) {
            $selected = array('group' => '', 'item' => '');
        }
        return '<span ' . ($id ? 'id="' . $id . '-group" ' : '') . 'class="fof-groupedlist-group ' . $class . '>' . htmlspecialchars($selected['group'], ENT_COMPAT, 'UTF-8') . '</span>' . '<span ' . ($id ? 'id="' . $id . '-item" ' : '') . 'class="fof-groupedlist-item ' . $class . '>' . htmlspecialchars($selected['item'], ENT_COMPAT, 'UTF-8') . '</span>';
    }