*/ protected array $attributes = [ 'for' => '', 'name' => '', 'value' => '', 'class' => '', ]; protected string $text = ''; protected string $hint = ''; protected bool $isOptional = false; public function render(): string { $labelClass = $this->attributes['class']; unset($this->attributes['class']); $attributes = stringify_attributes($this->attributes); $optionalText = $this->isOptional ? '(' . lang('Common.optional') . ')' : ''; $hint = $this->hint !== '' ? hint_tooltip($this->hint, 'ml-1') : ''; return <<{$this->text}{$optionalText}{$hint} CODE_SAMPLE; } }