Pear DataObject_FormBuilder displays nothing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sarah

    Pear DataObject_FormBuilder displays nothing

    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!
  • Andy Hassall

    #2
    Re: Pear DataObject_Form Builder displays nothing

    On 23 Jan 2005 04:28:48 -0800, chixors@gmail.c om (Sarah) wrote:
    [color=blue]
    >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>.[/color]

    Are you printing that exact string anywhere? Because that's what you get in
    View Source from Internet Explorer when it receives an entirely blank page;
    i.e. it doesn't show you the real, empty source, it makes up a dummy partial
    HTML document.

    Could it be that there is a fatal error, such as a parse error, aborting your
    script before it outputs _anything_, and that you have error_reporting set too
    low, and/or display_errors turned off?

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • chixors@gmail.com

      #3
      Re: Pear DataObject_Form Builder displays nothing

      > Are you printing that exact string anywhere? Because that's what you
      get in[color=blue]
      > View Source from Internet Explorer when it receives an entirely blank[/color]
      page;[color=blue]
      > i.e. it doesn't show you the real, empty source, it makes up a dummy[/color]
      partial[color=blue]
      > HTML document.[/color]

      I'm not printing that exact string, I think Firefox is doing what you
      suggest IE does -> printing dummy html in replacement of a blank page.
      [color=blue]
      > Could it be that there is a fatal error, such as a parse error,[/color]
      aborting your[color=blue]
      > script before it outputs _anything_, and that you have[/color]
      error_reporting set too[color=blue]
      > low, and/or display_errors turned off?[/color]

      I know error detection is enabled as to get to that point I got through
      some 'file doesn't exist' and 'db connection' errors. I've enabled
      debugging in the config inc file but that did nothing. I don't know
      enough about FormBuilder to know where it would cause this kind of
      problem and there isn't enough tutorials or documentation to learn :(

      Comment

      Working...