From 12a4e4d1ed827c59290838d5a11d75ad32aa28f1 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 8 May 2015 16:15:16 +0200 Subject: start of rewriting the form handling This is jsut a small beginning. Not all elements are there, yet. It's also completely untested so far. --- inc/Form/Label.php | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 inc/Form/Label.php (limited to 'inc/Form/Label.php') diff --git a/inc/Form/Label.php b/inc/Form/Label.php new file mode 100644 index 000000000..c8a862613 --- /dev/null +++ b/inc/Form/Label.php @@ -0,0 +1,46 @@ +label = $label; + } + + /** + * Get or set the element's label text + * + * @param null|string $value + * @return string|$this + */ + public function val($value = null) { + if($value !== null) { + $this->label = $value; + return $this; + } + return $this->label; + } + + /** + * The HTML representation of this element + * + * @return string + */ + public function toHTML() { + return ''; + } +} -- 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/Label.php | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'inc/Form/Label.php') diff --git a/inc/Form/Label.php b/inc/Form/Label.php index c8a862613..8dcd7cd5f 100644 --- a/inc/Form/Label.php +++ b/inc/Form/Label.php @@ -5,11 +5,7 @@ namespace dokuwiki\Form; * Class Label * @package dokuwiki\Form */ -class Label extends Element { - /** - * @var string the actual label text - */ - public $label = ''; +class Label extends ValueElement { /** * Creates a new Label @@ -17,22 +13,7 @@ class Label extends Element { * @param string $label */ public function __construct($label) { - parent::__construct('label'); - $this->label = $label; - } - - /** - * Get or set the element's label text - * - * @param null|string $value - * @return string|$this - */ - public function val($value = null) { - if($value !== null) { - $this->label = $value; - return $this; - } - return $this->label; + parent::__construct('label', $label); } /** @@ -41,6 +22,6 @@ class Label extends Element { * @return string */ public function toHTML() { - return ''; + return ''; } } -- cgit v1.2.3