Form.php - why returnStart ?

From: Date: Tue, 23 Jan 2001 14:33:58 +0000
Subject: Form.php - why returnStart ?
References: 1  Groups: php.pear 
Request: Send a blank email to php-pear+get-1134@lists.php.net to get a copy of this message
Hi Urs, hi Stig, hi all, I have been trying to use the Form.php class to generate a form with a mix of text and file (upload) fields. Reading the code of that class, I couldn't figure out why there were start and returnStart functions ? I may be mistaken but I think these two functions could be put in just one ? Or maybe I am wrong and then I hope you can explain me where is the difference. I was also thinking it could be useful to have a sort of template for creating form cells instead of having to modify every return... functions. function returnTextRow($name, $title, $default = '', $size = HTML_FORM_TEXT_SIZE) { $str .= " <TR>\n"; $str .= " <TH ALIGN=\"right\">$title</TH>"; $str .= " <TD>"; $str .= $this->returnText($name, $default, $size); $str .= "</TD>\n"; $str .= " </TR>\n"; return $str; } In the code, this supposes I have created a table and I want my header beside my text field (which is how it is most of the time) but if I want it somewhere else, I have to change html in every return... function. It would be also nice to have the possibility to add errors above the field (ex: Don't forget to fill this field...) like they do in phplib oohform or the normal form on phpwizard.net. Could you please explain me how this Form.php class works and if I missed some features ? Thanks very much. Bertrand Mansion

« previous php.pear (#1134) next »