public function toHTML() { if ($this->attributes['label'] === null) { return $this->renderOptions(); } $html = '<optgroup ' . buildAttributes($this->attrs()) . '>'; $html .= $this->renderOptions(); $html .= '</optgroup>'; return $html; }