More adjusted API tests
[dokuwiki.git] / inc / Form / ButtonElement.php
blobb68554a8ca9c3a54cbee39b0b801174af7ba6821
1 <?php
3 namespace dokuwiki\Form;
5 /**
6 * Class ButtonElement
8 * Represents a simple button
10 * @package dokuwiki\Form
12 class ButtonElement extends Element
14 /** @var string HTML content */
15 protected $content = '';
17 /**
18 * @param string $name
19 * @param string $content HTML content of the button. You have to escape it yourself.
21 public function __construct($name, $content = '')
23 parent::__construct('button', ['name' => $name, 'value' => 1]);
24 $this->content = $content;
27 /**
28 * The HTML representation of this element
30 * @return string
32 public function toHTML()
34 return '<button ' . buildAttributes($this->attrs(), true) . '>' . $this->content . '</button>';