1<?php 2namespace dokuwiki\Form; 3 4/** 5 * Class TagElement 6 * 7 * Creates a self closing HTML tag 8 * 9 * @package dokuwiki\Form 10 */ 11class TagElement extends ValueElement { 12 13 /** 14 * @param string $tag 15 * @param array $attributes 16 */ 17 public function __construct($tag, $attributes = array()) { 18 parent::__construct('tag', $tag, $attributes); 19 } 20 21 /** 22 * The HTML representation of this element 23 * 24 * @return string 25 */ 26 public function toHTML() { 27 return '<'.$this->val().' '.buildAttributes($this->attrs()).' />'; 28 } 29} 30