From de19515f04567db78bd41d5bff68a88bfb8c2a22 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 8 May 2015 19:12:21 +0200 Subject: started with the compatibility layer --- inc/Form/HTMLElement.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 inc/Form/HTMLElement.php (limited to 'inc/Form/HTMLElement.php') 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 @@ +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(); + } +} -- cgit v1.2.3 From 64744a10c5578602141ae2977274eec3fcff1f44 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 8 May 2015 20:37:06 +0200 Subject: more elements and work on the legacy support --- inc/Form/HTMLElement.php | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'inc/Form/HTMLElement.php') diff --git a/inc/Form/HTMLElement.php b/inc/Form/HTMLElement.php index 06f27d736..591cf472f 100644 --- a/inc/Form/HTMLElement.php +++ b/inc/Form/HTMLElement.php @@ -8,33 +8,14 @@ namespace dokuwiki\Form; * * @package dokuwiki\Form */ -class HTMLElement extends Element { +class HTMLElement extends ValueElement { - /** - * @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; + parent::__construct('html', $html); } /** -- cgit v1.2.3