I'm having problems getting the FormBuilder package to work.
I've spent the last 3hrs reading what little documentation and
examples I could find and the idea seems great, if only it'll actually
display a form.
I'm not getting any error message, and I know that my DB_DataObjects
are working as I'm able to auto generate the classes and search them.
However using the following code which I believe is meant to display a
form for the 'users' table, does absolutly nothing except displayed
<html><body></body></html>.
I did some experimenting to see if there was something wrong with
displaying anything, and I found that nothing would print after
$builder->getForm() and I have no idea why :\
CODE:
require_once('D B/DataObject.php' );
require_once('D B/DataObject/FormBuilder.php ');
$config = parse_ini_file( 'example.ini', true);
foreach($config as $class => $values) {
$options = &PEAR::getStati cProperty($clas s, 'options');
$options = $values;
}
$_DB_DATAOBJECT _FORMBUILDER['CONFIG'] =
$config['DB_DataObject_ FormBuilder'];
$building = DB_DataObject:: factory('users' );
if (PEAR::isError( $building)) {
die($building->getMessage() );
}
$builder = DB_DataObject_F ormBuilder::cre ate($building);
if (PEAR::isError( $builder)) {
die($builder->getMessage() );
}
$form = $builder->getForm();
if (PEAR::isError( $form)) {
die($form->getMessage() );
}
if ($form->validate()) {
$form->process(array( &$builder,'proc essForm'), false);
echo 'New buidler ID: '.$builder->bldg_ID;
}
echo $form->toHtml();
This isn't even my code, it was an example from the makers of
FormBuilder.
Any help at all would be greatly appreciated!
I've spent the last 3hrs reading what little documentation and
examples I could find and the idea seems great, if only it'll actually
display a form.
I'm not getting any error message, and I know that my DB_DataObjects
are working as I'm able to auto generate the classes and search them.
However using the following code which I believe is meant to display a
form for the 'users' table, does absolutly nothing except displayed
<html><body></body></html>.
I did some experimenting to see if there was something wrong with
displaying anything, and I found that nothing would print after
$builder->getForm() and I have no idea why :\
CODE:
require_once('D B/DataObject.php' );
require_once('D B/DataObject/FormBuilder.php ');
$config = parse_ini_file( 'example.ini', true);
foreach($config as $class => $values) {
$options = &PEAR::getStati cProperty($clas s, 'options');
$options = $values;
}
$_DB_DATAOBJECT _FORMBUILDER['CONFIG'] =
$config['DB_DataObject_ FormBuilder'];
$building = DB_DataObject:: factory('users' );
if (PEAR::isError( $building)) {
die($building->getMessage() );
}
$builder = DB_DataObject_F ormBuilder::cre ate($building);
if (PEAR::isError( $builder)) {
die($builder->getMessage() );
}
$form = $builder->getForm();
if (PEAR::isError( $form)) {
die($form->getMessage() );
}
if ($form->validate()) {
$form->process(array( &$builder,'proc essForm'), false);
echo 'New buidler ID: '.$builder->bldg_ID;
}
echo $form->toHtml();
This isn't even my code, it was an example from the makers of
FormBuilder.
Any help at all would be greatly appreciated!
Comment