From 88d4ce5e5ad8c989c968baa6141dc0f763ffe612 Mon Sep 17 00:00:00 2001
From: Derek Allard
Lets you generate a standard button element. You can minimally pass the button name and content in the first and second parameter:
-echo form_button(’name’,’content’);
+echo form_button('name','content');
// Would produce
<button name="name" type="submit">Content</button>
@@ -355,11 +355,11 @@ echo form_button(’name’,’content’);
Or you can pass an associative array containing any data you wish your form to contain:
$data = array(
- ‘name’ => ‘button’,
- ‘id’ => ‘button’,
- ‘value’ => ‘true’,
- ‘type’ => ‘reset’,
- ‘content’ => ‘Reset’
+ 'name' => 'button',
+ 'id' => 'button',
+ 'value' => 'true',
+ 'type' => 'reset',
+ 'content' => 'Reset'
);
echo form_button($data);
@@ -370,8 +370,8 @@ echo form_button($data);
If you would like your form to contain some additional data, like JavaScript, you can pass it as a string in the third parameter:
-$js = ‘onClick="some_function()"’;
-echo form_button(’mybutton’, ‘Click Me’, $js);
+$js = 'onClick="some_function()"';
+echo form_button('mybutton', 'Click Me', $js);
--
cgit v1.2.3-24-g4f1b