diff options
author | Andreas Gohr <andi@splitbrain.org> | 2015-05-08 19:12:21 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2015-05-08 19:12:21 +0200 |
commit | de19515f04567db78bd41d5bff68a88bfb8c2a22 (patch) | |
tree | e478b1cdf6a186c162f6b62b8dce5addd2f7c17d /inc/Form/HTMLElement.php | |
parent | 6d0ceaf93ca31dfb83fd4325ef2eecd9cef733c0 (diff) | |
download | rpg-de19515f04567db78bd41d5bff68a88bfb8c2a22.tar.gz rpg-de19515f04567db78bd41d5bff68a88bfb8c2a22.tar.bz2 |
started with the compatibility layer
Diffstat (limited to 'inc/Form/HTMLElement.php')
-rw-r--r-- | inc/Form/HTMLElement.php | 48 |
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(); + } +} |