public function getHtmlElement() { $el = new Element('select', ['name' => $this->getName()]); foreach ($this->getConfig() as $value => $label) { $option = new Element('option', ['value' => $value]); $option->setText($label); if (strval($value) === strval($this->getValue())) { $option->setAttribute('selected', true); } $el->appendChild($option); } return $el; }