PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_QuickForm » Bug #1806

length of function lists to onQuickFormEvent limited

Details

Request #1806length of function lists to onQuickFormEvent limited
Submitted2004-07-06 12:24 UTC
Fromsimon dot bailey at uibk dot ac dot at
StatusNo Feedback
PackageHTML_QuickForm
PHP Version4.3.4
Roadmaps(Not assigned)

Comments

[2004-07-06 12:24 UTC] simon dot bailey at uibk dot ac dot at

Description:
------------
Using HTML_QuickForm, version 3.2.3, it is not possible to create custom elements with more than 5 arguments in the constructor.

i have traced this problem to HTML/QuickForm/element.php, where in the function onQuickFormEvent, case 'createElement' calls the constructor with only 5 arguments, as seen below

this limitation is not documented anywhere.

would it be possible to remove this limitation?

Reproduce code:
---------------
<<<
From HTML/QuickForm/element.php, lines 345-347:
case 'createElement':
$className = get_class($this);
$this->$className($arg[0], $arg[1], $arg[2], $arg[3], $arg[4]);
>>>

<<<
my custom constructor:
[...]
function HTML_QuickForm_dblselect($elementName=null, $elementLabel=null, $attributes=null, $selectAttributes=null, $buttonAttributes=null, $spacer=null)
{
[...]
>>>

Expected result:
----------------
I expected to receive a value for $spacer if passed.

Actual result:
--------------
$spacer is always null, no matter what happens. after hacking element.php to accept 6 arguments to an element constructor, it works as expected.

[2004-07-06 12:28 UTC] bmansion at mamasam dot com

What about using an options array like in other custom elements. You can look at the date element for an example.