diff options
Diffstat (limited to 'inc/Form/Label.php')
-rw-r--r-- | inc/Form/Label.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/inc/Form/Label.php b/inc/Form/Label.php new file mode 100644 index 000000000..8dcd7cd5f --- /dev/null +++ b/inc/Form/Label.php @@ -0,0 +1,27 @@ +<?php +namespace dokuwiki\Form; + +/** + * Class Label + * @package dokuwiki\Form + */ +class Label extends ValueElement { + + /** + * Creates a new Label + * + * @param string $label + */ + public function __construct($label) { + parent::__construct('label', $label); + } + + /** + * The HTML representation of this element + * + * @return string + */ + public function toHTML() { + return '<label ' . buildAttributes($this->attrs()) . '>' . hsc($this->val()) . '</label>'; + } +} |