Re: Re-post: Formbuilder and quickform controller processing
| From: | Justin Patrin | Date: | Tue, 14 Jun 2005 16:20:36 +0000 |
| Subject: | Re: Re-post: Formbuilder and quickform controller processing | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19619@lists.php.net to get a copy of this message | ||
On 6/14/05, Andrew Wooldridge <andrew.r.wooldridge@vanderbilt.edu> wrote:
> I posted this last week, but never saw it in the list so I'm attempting to
> repost. I've learned since then that the lines (see below)...
>
> $fb = $page->fb;
> $page->process(array(&$fb, 'processForm'), false);
>
> .....do not process the form object because there is no form object! $fb is
> created inside the buildForm method of the PageFirst (extends
> HTML_QuickForm_Page ) class. I'm currently trying to make this object a
> public member of the PageFirst class to make &$page->fb refer to a
> formbuilder object by reference. OOP gurus out there give me a pointer
> please!
>
>
> attn: PEAR users,
>
> I've built a decent multi-page form using formbuilder and quickform
> controller. Currently, my mysql database underneath formbuilder is not
> being populated when the QFC is processed.
>
> My ActionProcess class looks like this:
>
> class ActionProcess extends HTML_QuickForm_Action
> {
> function perform(&$page, $actionName)
> {
> //this is in every QFC example
> echo "Submit successful?<br>\n<pre>\n";
> var_dump($page->controller->exportValues());
> echo "\n</pre>\n";
>
> //this is what works with formbuilder sans QFC, which is why
> //I tried it here...but here no new records created in the db!
> if($page->validate()) {
> $fb = $page->fb;
> $page->process(array(&$fb, 'processForm'), false);
Instead of setting it to $fb just do:
$page->process(array(&$page->fb, 'processForm'), false);
Try a print_r of $page->fb to make sure it's what you think it is. Try
turning on DO debug:
DB_DataObject::debugLevel(5);
before processing.
> }
> }
> }
>
>
> I'm at my wit's end about how to properly process these formbuilder-built
> forms adding them to my database. Can someone who's done this before please
> give me some sample code and point me in the right direction? Thanks in
> advance. -A
>
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Justin Patrin