helperText === null ? '' : '' . $this->helperText . '';
$labelAttributes = [
'for' => $this->id,
'isOptional' => $this->required ? 'false' : 'true',
];
if ($this->hintText) {
$labelAttributes['hint'] = $this->hintText;
}
$labelAttributes = stringify_attributes($labelAttributes);
// remove field specific attributes to inject the rest to Form Component
$fieldComponentAttributes = $this->attributes;
unset($fieldComponentAttributes['as']);
unset($fieldComponentAttributes['label']);
unset($fieldComponentAttributes['class']);
unset($fieldComponentAttributes['helperText']);
unset($fieldComponentAttributes['hintText']);
$fieldComponentAttributes = flatten_attributes($fieldComponentAttributes);
return <<
{$this->label}
as} {$fieldComponentAttributes} class="mb-1"/>
{$helperText}
HTML;
}
}