Re: New package: DB_DataObject_FormBuilder
| From: | Markus Wolff | Date: | Mon, 25 Aug 2003 17:22:54 +0000 |
| Subject: | Re: New package: DB_DataObject_FormBuilder | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-20496@lists.php.net to get a copy of this message | ||
Ron McClain wrote:
Ok, just making sure ;) Anyhow, I wonder if you could perhaps add a call to $this->_do->validate() in processForm? That way I can use my existing validation code for the extended DO classes.Hmm, I always do the call to validate() outside the class, in the main script: $obj =& new myDataObject); $fg =& DB_DataObject_FormBuilder::create($obj); $form =& $fg->getForm(); if ($form->validate()) {
$form->process(array(&$fg,'processForm'), false);} How exactly would you want to implement it in the process method? Personally, I think the call to validate and triggering the process function should always stay out of a class, as its part of the script flow, not of the backend logic. But as always, I´m open to different opinions ;-) Regards, Markus