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