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