/** * Inserts an element in the container * * If the reference object is not given, the element will be appended. * * @param HTML_QuickForm2_Node Element to insert * @param HTML_QuickForm2_Node Reference to insert before * @return HTML_QuickForm2_Node Inserted element */ public function insertBefore(HTML_QuickForm2_Node $element, HTML_QuickForm2_Node $reference = null) { if (null === $reference) { return $this->appendChild($element); } return parent::insertBefore($this->renameChild($element), $reference); }