summaryrefslogtreecommitdiff
path: root/inc/Form/Form.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-05-08 20:37:06 +0200
committerAndreas Gohr <andi@splitbrain.org>2015-05-08 20:37:06 +0200
commit64744a10c5578602141ae2977274eec3fcff1f44 (patch)
tree83c0f7bbac3ec45a05ce4da474aebb567ec27845 /inc/Form/Form.php
parentde19515f04567db78bd41d5bff68a88bfb8c2a22 (diff)
downloadrpg-64744a10c5578602141ae2977274eec3fcff1f44.tar.gz
rpg-64744a10c5578602141ae2977274eec3fcff1f44.tar.bz2
more elements and work on the legacy support
Diffstat (limited to 'inc/Form/Form.php')
-rw-r--r--inc/Form/Form.php65
1 files changed, 64 insertions, 1 deletions
diff --git a/inc/Form/Form.php b/inc/Form/Form.php
index 19cc05065..420399fb1 100644
--- a/inc/Form/Form.php
+++ b/inc/Form/Form.php
@@ -67,6 +67,8 @@ class Form extends Element {
return $this;
}
+ #region Element adding functions
+
/**
* Adds an element to the end of the form
*
@@ -149,12 +151,73 @@ class Form extends Element {
*
* @param $html
* @param int $pos
- * @return Element
+ * @return HTMLElement
*/
public function addHTML($html, $pos = -1) {
return $this->addElement(new HTMLElement($html), $pos);
}
+ /**
+ * Add a closed HTML tag to the form
+ *
+ * @param $tag
+ * @param int $pos
+ * @return TagElement
+ */
+ public function addTag($tag, $pos = -1) {
+ return $this->addElement(new TagElement($tag), $pos);
+ }
+
+ /**
+ * Add an open HTML tag to the form
+ *
+ * Be sure to close it again!
+ *
+ * @param $tag
+ * @param int $pos
+ * @return TagOpenElement
+ */
+ public function addTagOpen($tag, $pos = -1) {
+ return $this->addElement(new TagOpenElement($tag), $pos);
+ }
+
+ /**
+ * Add a closing HTML tag to the form
+ *
+ * Be sure it had been opened before
+ *
+ * @param $tag
+ * @param int $pos
+ * @return TagCloseElement
+ */
+ public function addTagClose($tag, $pos = -1) {
+ return $this->addElement(new TagCloseElement($tag), $pos);
+ }
+
+
+ /**
+ * Open a Fieldset
+ *
+ * @param $legend
+ * @param int $pos
+ * @return FieldsetOpenElement
+ */
+ public function addFieldsetOpen($legend='', $pos = -1) {
+ return $this->addElement(new FieldsetOpenElement($legend), $pos);
+ }
+
+ /**
+ * Close a fieldset
+ *
+ * @param int $pos
+ * @return TagCloseElement
+ */
+ public function addFieldsetClose($pos = -1) {
+ return $this->addElement(new FieldsetCloseElement(), $pos);
+ }
+
+ #endregion
+
protected function balanceFieldsets() {
//todo implement!
}