Re: QuickForm::setDefaults
| From: | Alexey Borzov | Date: | Mon, 03 Mar 2003 10:45:30 +0000 |
| Subject: | Re: QuickForm::setDefaults | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4024@lists.php.net to get a copy of this message | ||
3 Март 2003 11:35, Bertrand Mansion написал:
> If an element has a default value, this value needs to be set before the
> element is created. It is what a default value is meant for. If you need to
> change an element value afterwards, use $element->setValue(); or maybe I
> could add a $form->setValues($elementArr, $valuesArr) if you need it and
> explain me what for.
My personal POW is that the approach where HTML_QuickForm had a loadValues()
method that explicitly loaded the submitted values was a more logical one. :[
Now, when you got rid of it, the code to load values is more complicated and
there are additional problems like inability to call setDefaults anywhere you
like.