3 namespace dokuwiki\Form
;
6 * Class TagCloseElement
8 * Creates an HTML close tag. You have to make sure it has been opened
9 * before or this will produce invalid HTML
11 * @package dokuwiki\Form
13 class TagCloseElement
extends ValueElement
17 * @param array $attributes
19 public function __construct($tag, $attributes = [])
21 parent
::__construct('tagclose', $tag, $attributes);
27 * @param string $class
29 * @throws \BadMethodCallException
31 public function addClass($class)
33 throw new \
BadMethodCallException('You can\t add classes to closing tag');
39 * @param null|string $id
41 * @throws \BadMethodCallException
43 public function id($id = null)
48 throw new \
BadMethodCallException('You can\t add ID to closing tag');
56 * @param null|string $value
58 * @throws \BadMethodCallException
60 public function attr($name, $value = null)
62 if ($value === null) {
65 throw new \
BadMethodCallException('You can\t add attributes to closing tag');
72 * @param array|null $attributes
74 * @throws \BadMethodCallException
76 public function attrs($attributes = null)
78 if ($attributes === null) {
81 throw new \
BadMethodCallException('You can\t add attributes to closing tag');
86 * The HTML representation of this element
90 public function toHTML()
92 return '</' . $this->val() . '>';