Re: DataObject FormBuilder QuickForm Functions missing?
| From: | Justin Patrin | Date: | Fri, 22 Oct 2004 21:31:43 +0000 |
| Subject: | Re: DataObject FormBuilder QuickForm Functions missing? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15056@lists.php.net to get a copy of this message | ||
On Fri, 22 Oct 2004 16:19:48 -0500, Sparacio, Sal
<salsparacio@newton-associates.com> wrote:
> I am trying to use DO's FormBuilder to Build my forms.
> I have setup DO right but when I try to put the code in it starts giving me
> errors about weird functions missing.
> It looks like FormBuilder is not seeing the quickform builder, or something
> like that.
>
> Notice: Undefined index: DB_DataObject_FormBuilder in
> D:\WWW\dev\bpo_forms\config_inc.php on line 18
> <> Agent <>
> Fatal error: Call to undefined function: _createformobject() in
> C:\php\PEAR\DB\DataObject\FormBuilder.php on line 772
>
> So I included them in the sample script that's in the CSV, then I get::
>
> Notice: Undefined index: DB_DataObject_FormBuilder in
> D:\WWW\dev\bpo_forms\config_inc.php on line 18
>
> Fatal error: Class db_dataobject_formbuilder_quickform: Cannot inherit from
> undefined class db_dataobject_formbuilder in
> C:\php\PEAR\DB\DataObject\FormBuilder\QuickForm.php on line 29
>
> I have a due date of Monday for theses forms and I am pulling my hair out,
> because there is no good, straight forward tutorial on the form builder.
> After this I am going to make one, because I don't want anyone else to have
> to go threw this.
>
This is because you're using direct instantiation instead of the
factory method, create(). Instead of this:
$fb = new DB_DataObject_FormBuilder($do);
use this:
$fb = DB_DataObject_FormBuilder::create($do);
--
paperCrane --Justin Patrin--