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