summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <git@evanprodromou.name>2009-01-14 01:04:09 -0500
committerEvan Prodromou <git@evanprodromou.name>2009-01-14 01:04:09 -0500
commite1907c9cb5324f7349de814c09728a64be589f3a (patch)
tree4e137ff0fc3eee64997252f8d95ae6170741e539 /lib
parentab158502b0257c3cd578395ed6f30510ea3c78db (diff)
Add a name parameter to a couple of the form elements
Diffstat (limited to 'lib')
-rw-r--r--lib/htmloutputter.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php
index 143612b8f..095f4d478 100644
--- a/lib/htmloutputter.php
+++ b/lib/htmloutputter.php
@@ -258,15 +258,14 @@ class HTMLOutputter extends XMLOutputter
*
* @param string $id element ID, must be unique on page
* @param string $value hidden element value, default null
+ * @param string $name name, if different than ID
*
* @return void
- *
- * @todo add a $name parameter
*/
- function hidden($id, $value)
+ function hidden($id, $value, $name=null)
{
- $this->element('input', array('name' => $id,
+ $this->element('input', array('name' => ($name) ? $name : $id,
'type' => 'hidden',
'id' => $id,
'value' => $value));
@@ -305,18 +304,19 @@ class HTMLOutputter extends XMLOutputter
* @param string $id element ID, must be unique on page
* @param string $label text of the button
* @param string $cls class of the button, default 'submit'
+ * @param string $name name, if different than ID
*
* @return void
*
* @todo add a $name parameter
*/
- function submit($id, $label, $cls='submit')
+ function submit($id, $label, $cls='submit', $name=null)
{
$this->elementStart('p');
$this->element('input', array('type' => 'submit',
'id' => $id,
- 'name' => $id,
+ 'name' => ($name) ? $name : $id,
'class' => $cls,
'value' => $label));
$this->elementEnd('p');