summaryrefslogtreecommitdiff
path: root/inc/Form/HTMLElement.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/Form/HTMLElement.php')
-rw-r--r--inc/Form/HTMLElement.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/inc/Form/HTMLElement.php b/inc/Form/HTMLElement.php
new file mode 100644
index 000000000..06f27d736
--- /dev/null
+++ b/inc/Form/HTMLElement.php
@@ -0,0 +1,48 @@
+<?php
+namespace dokuwiki\Form;
+
+/**
+ * Class HTMLElement
+ *
+ * Holds arbitrary HTML that is added as is to the Form
+ *
+ * @package dokuwiki\Form
+ */
+class HTMLElement extends Element {
+
+ /**
+ * @var string the raw HTML held by this element
+ */
+ protected $html = '';
+
+ /**
+ * @param string $html
+ */
+ public function __construct($html) {
+ parent::__construct('html');
+ $this->val($html);
+ }
+
+ /**
+ * Get or set the element's content
+ *
+ * @param null|string $html
+ * @return string|$this
+ */
+ public function val($html = null) {
+ if($html !== null) {
+ $this->html = $html;
+ return $this;
+ }
+ return $this->html;
+ }
+
+ /**
+ * The HTML representation of this element
+ *
+ * @return string
+ */
+ public function toHTML() {
+ return $this->val();
+ }
+}