1<?php
2
3namespace dokuwiki\Form;
4
5/**
6 * Class TagOpenElement
7 *
8 * Creates an open HTML tag. You have to make sure you close it
9 * again or this will produce invalid HTML
10 *
11 * @package dokuwiki\Form
12 */
13class TagOpenElement extends ValueElement
14{
15    /**
16     * @param string $tag
17     * @param array $attributes
18     */
19    public function __construct($tag, $attributes = [])
20    {
21        parent::__construct('tagopen', $tag, $attributes);
22    }
23
24    /**
25     * The HTML representation of this element
26     *
27     * @return string
28     */
29    public function toHTML()
30    {
31        return '<' . $this->val() . ' ' . buildAttributes($this->attrs()) . '>';
32    }
33}
34