summaryrefslogtreecommitdiffstats
path: root/system/helpers/form_helper.php
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-03-18 12:50:00 +0100
committerDerek Allard <derek.allard@ellislab.com>2008-03-18 12:50:00 +0100
commit707d0e0f1e0ea922fbe38d8b43f1fb4e2ea001e5 (patch)
tree7c82f6932d6bc2c4e079d7bedb67e9299607eaf4 /system/helpers/form_helper.php
parentd888c3551189526e1b63cf09206dd40aad5bff5b (diff)
added form_button to form helper
Diffstat (limited to 'system/helpers/form_helper.php')
-rw-r--r--system/helpers/form_helper.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 7c3b16ff1..db41cb5cd 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -387,6 +387,33 @@ if (! function_exists('form_reset'))
// ------------------------------------------------------------------------
/**
+ * Form Button
+ *
+ * @access public
+ * @param mixed
+ * @param string
+ * @param string
+ * @return string
+ */
+if (! function_exists('form_button'))
+{
+ function form_button($data = '', $content = '', $extra = '')
+ {
+ $defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'type' => 'submit');
+
+ if ( is_array($data) AND isset($data['content']))
+ {
+ $content = $data['content'];
+ unset($data['content']); // content is not an attribute
+ }
+
+ return "<button ".parse_form_attributes($data, $defaults).$extra.">".$content."</button>\n";
+ }
+}
+
+// ------------------------------------------------------------------------
+
+/**
* Form Label Tag
*
* @access public