diff options
author | Andreas Gohr <andi@splitbrain.org> | 2015-08-18 20:12:32 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2015-08-18 20:12:32 +0200 |
commit | 8f0df229ed3e82191f118594ea5145c9d5942d7b (patch) | |
tree | a867583b058344e1cdbbb5837f23e1e5aff97316 /inc/Form/Form.php | |
parent | 08099e4fe1e56308bc42cc639d187863088494bd (diff) | |
download | rpg-8f0df229ed3e82191f118594ea5145c9d5942d7b.tar.gz rpg-8f0df229ed3e82191f118594ea5145c9d5942d7b.tar.bz2 |
Form: added Button element #1312
Diffstat (limited to 'inc/Form/Form.php')
-rw-r--r-- | inc/Form/Form.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/inc/Form/Form.php b/inc/Form/Form.php index 625557fa1..738f2bcf8 100644 --- a/inc/Form/Form.php +++ b/inc/Form/Form.php @@ -234,6 +234,30 @@ class Form extends Element { } /** + * Adds a simple button, escapes the content for you + * + * @param string $name + * @param string $content + * @param int $pos + * @return Element + */ + public function addButton($name, $content, $pos = -1) { + return $this->addElement(new ButtonElement($name, hsc($content)), $pos); + } + + /** + * Adds a simple button, allows HTML for content + * + * @param string $name + * @param string $html + * @param int $pos + * @return Element + */ + public function addButtonHTML($name, $html, $pos = -1) { + return $this->addElement(new ButtonElement($name, $html), $pos); + } + + /** * Add fixed HTML to the form * * @param $html |