cvs: pear /HTML_QuickForm QuickForm.php
| From: | Bertrand Mansion | Date: | Tue, 18 Feb 2003 13:39:25 +0000 |
| Subject: | cvs: pear /HTML_QuickForm QuickForm.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-8935@lists.php.net to get a copy of this message | ||
mansion Tue Feb 18 08:39:25 2003 EDT
Modified files:
/pear/HTML_QuickForm QuickForm.php
Log:
Fix a too long standing API inconsistency in addElementGroup().
addElementGroup is now deprecated, use addGroup() instead.
Parameters order in addGroup() are more consistent with addElement().
Index: pear/HTML_QuickForm/QuickForm.php
diff -u pear/HTML_QuickForm/QuickForm.php:1.60 pear/HTML_QuickForm/QuickForm.php:1.61
--- pear/HTML_QuickForm/QuickForm.php:1.60 Tue Feb 18 08:30:33 2003
+++ pear/HTML_QuickForm/QuickForm.php Tue Feb 18 08:39:25 2003
@@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
-// $Id: QuickForm.php,v 1.60 2003/02/18 13:30:33 mansion Exp $
+// $Id: QuickForm.php,v 1.61 2003/02/18 13:39:25 mansion Exp $
require_once('PEAR.php');
require_once('HTML/Common.php');
@@ -585,20 +585,39 @@
} // end func addElement
// }}}
- // {{{ addElementGroup()
+ // {{{ addGroup()
/**
* Adds an element group
* @param array $elements array of elements composing the group
+ * @param string $name (optional)group name
+ * @param string $label (optional)group label
+ * @param string $separator (optional)string to seperate elements
+ * @return reference to added group of elements
+ * @since 2.8
+ * @access public
+ * @throws PEAR_Error
+ */
+ function &addGroup($elements, $name=null, $groupLabel='', $separator=null)
+ {
+ return $this->addElement('group', $name, $groupLabel, $elements, $separator);
+ } // end func addGroup
+
+ // }}}
+ // {{{ addElementGroup()
+
+ /**
+ * Adds an element group (DEPRECATED, use addGroup instead)
+ * @param array $elements array of elements composing the group
* @param string $label (optional)group label
* @param string $name (optional)group name
* @param string $separator (optional)string to seperate elements
- * @return index of element
- * @since 1.0
+ * @return reference to added group of elements
+ * @since 1.0
* @access public
* @throws PEAR_Error
*/
- function addElementGroup($elements, $groupLabel='', $name=null, $separator=null)
+ function &addElementGroup($elements, $groupLabel='', $name=null, $separator=null)
{
return $this->addElement('group', $name, $groupLabel, $elements, $separator);
} // end func addElementGroup