diff options
author | Andreas Gohr <andi@splitbrain.org> | 2015-05-08 20:37:06 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2015-05-08 20:37:06 +0200 |
commit | 64744a10c5578602141ae2977274eec3fcff1f44 (patch) | |
tree | 83c0f7bbac3ec45a05ce4da474aebb567ec27845 /inc/Form/Label.php | |
parent | de19515f04567db78bd41d5bff68a88bfb8c2a22 (diff) | |
download | rpg-64744a10c5578602141ae2977274eec3fcff1f44.tar.gz rpg-64744a10c5578602141ae2977274eec3fcff1f44.tar.bz2 |
more elements and work on the legacy support
Diffstat (limited to 'inc/Form/Label.php')
-rw-r--r-- | inc/Form/Label.php | 25 |
1 files changed, 3 insertions, 22 deletions
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 '<label ' . buildAttributes($this->attrs()) . '>' . hsc($this->label) . '</label>'; + return '<label ' . buildAttributes($this->attrs()) . '>' . hsc($this->val()) . '</label>'; } } |