/** * Generates the XML child in the given XML root. * This function should be implemented by every FormElement. * @param \SimpleXMLElement The XML node to add the current element to. */ protected function addFields(\SimpleXMLElement $xml) { parent::addFields($xml); $xml->disabled = $this->disabled; $xml->name = $this->name; $xml->value = $this->value; $xml->events->onblur = $this->onBlur; $xml->events->onfocus = $this->onFocus; }
/** * Adds standard data to the element. * @param \SimpleXMLElement The xml element to expand, by reference */ protected function addFields(\SimpleXMLElement $xml) { parent::addFields($xml); $xml->disabled = $this->disabled; $xml->name = $this->name; $xml->size = $this->size; $xml->value = $this->value; $xml->form = $this->form; if ($this->autoFocus) { $xml->autofocus = 'on'; } $xml->events->onblur = $this->onBlur; $xml->events->onchange = $this->onChange; $xml->events->onfocus = $this->onFocus; $xml->events->onselect = $this->onSelect; }