RE: [PEAR] DB_DataObject_FormBuilder steps
| From: | LIMBOURG Arnaud | Date: | Fri, 29 Aug 2003 10:55:22 +0000 |
| Subject: | RE: [PEAR] DB_DataObject_FormBuilder steps | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-7466@lists.php.net to get a copy of this message | ||
Hi,
my guess is that you need add some conf stuff for dataobjects, markus should
add that to the doc i guess
add the following before instantiating the dataobject
$options = &PEAR::getStaticProperty('DB_DataObject', 'options');
$config = parse_ini_file('conf_dataobjects.ini', true);
$options = $config['DB_DataObject'];
then add your code
$do =& new DataObjects_Prob();
And you should be running ... before you hit another obstacle that is ;)
Arnaud.
> "and write a script that passes one of the resulting objects
> to the FormBuilder class."
> I know I'm in deep here,
>
> From FormBuilder.php
>
> " * Most basic usage:
> * <code>
> * $do =& new MyDataObject();
> * // Insert "$do->get($some_id);" here to edit an existing
> object instead of making a new one
> * $fg =& DB_DataObject_FormBuilder::create($do);
> * $form =& $fg->getForm();
> * if ($form->validate()) {
> * $form->process($fg, false);
> * $form->freeze();
> * }
> * $form->display();
> * </code> "
>
> I put this in a php file,
>
> <?php
> $do =& new DataObjects_Prob(); "this is the name of a
> database createTables.php made"
> // Insert "$do->get($some_id);" here to edit an existing
> object instead of making a new one
> $fg =& DB_DataObject_FormBuilder::create($do);
> $form =& $fg->getForm();
> if ($form->validate()) {
> $form->process($fg, false);
> $form->freeze();
> }
> $form->display();
> ?>
>
> And get this error
>
> Fatal error: Cannot instantiate non-existent class:
> dataobjects_prob in
> /usr/local/www/data-dist/peartest/create/fb.php on line 2
>
> Then I added to fp.php
> require '/usr/local/lib/php/DB/DataObject/Prob.php';
> require '/usr/local/lib/php/DB/DataObject/FormBuilder.php';
>
> and get this error
>
> DB Error: not found
>
> Thanks for listening and helping me out.