LabelElement.php 574 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace dokuwiki\Form;
  3. /**
  4. * Class Label
  5. * @package dokuwiki\Form
  6. */
  7. class LabelElement extends ValueElement
  8. {
  9. /**
  10. * Creates a new Label
  11. *
  12. * @param string $label This is is raw HTML and will not be escaped
  13. */
  14. public function __construct($label)
  15. {
  16. parent::__construct('label', $label);
  17. }
  18. /**
  19. * The HTML representation of this element
  20. *
  21. * @return string
  22. */
  23. public function toHTML()
  24. {
  25. return '<label ' . buildAttributes($this->attrs()) . '>' . $this->val() . '</label>';
  26. }
  27. }