createAndSetupElement( 'input', '', [ "type" => "text", "placeholder" => $placeholder ] ); } private function createButton($content_node = null) { $button = $this->createAndSetupElement( 'button', '', [ "type" => "button" ] ); if (isset($content_node)) { $button->appendChild($this->importNode($content_node, true)); } else { $button->appendChild($this->createTextNode('Submit')); } return $button; } public function run(array $options = []) : bool { $options += [ self::KEY_OPTIONS_SEARCHINPUT_PLACEHOLDER => "", self::KEY_OPTIONS_BUTTON_CONTENT_NODE => null ]; $this->appendChild( $this->createSearchInput( $options[self::KEY_OPTIONS_SEARCHINPUT_PLACEHOLDER] ) ); $this->appendChild( $this->createButton( $options[self::KEY_OPTIONS_BUTTON_CONTENT_NODE] ) ); return true; } };