public function addOptGroup($label, $options) { if (empty($label)) { throw new \InvalidArgumentException(hsc('<optgroup> must have a label!')); } $this->optGroups[$label] = new OptGroup($label, $options); return end($this->optGroups); }