[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-general
Subject:    Re: [PEAR] populateOptions() on a non-object
From:       Justin Patrin <papercrane () gmail ! com>
Date:       2005-06-30 5:24:39
Message-ID: 432beae05062922243bdb0c2b () mail ! gmail ! com
[Download RAW message or body]

On 6/29/05, PHPDiscuss - PHP Newsgroups and mailing lists
<nyshab@gmail.com> wrote:
> Thanks Justin for your replies. Line # is 2052, apart I've double checked
> the scripts but everything seems ok
> 
> dataobject.ini
> --------------
> [DB_DataObject]
> database    = mysql://root:pass@localhost/testexp1
> schema_location = c:\apache\htdocs\SFBExample\sql\
> class_location  = c:\apache\htdocs\SFBExample\classes\
> require_prefix  = c:\apache\htdocs\SFBExample\classes\
> dont_die = false
> debug = 3
> debug_ignore_updates = 0
> 
> [DB_DataObject_Generator]
> extends_location = c:\apache\php\pear\DB\DataObject.php
> ; extends = DB_DataObjectOn
> extends = DB_DataObject
> 
> [DB_DataObject_FormBuilder]
> select_display_field = title

First off, this is an example for a very old version of FormBuilder.
These option names are no longer correct.

> Fatal error: Call to a member function populateOptions() on a non-object
> in c:\apache\php\pear\DB\DataObject\FormBuilder.php on line 2052
> 
> I've been checking the source code, could be this a PHP4/PHP5 issue?
> ($this->_populateOptions->... versus $this->populateOptions()-> ... or
> something like that) I'm new using this package and PEAR so I can't help
> much on this. Hope anybody can help me to start working with FB.
> Regards
> 

Try this example:
http://pear.reversefold.com/~papercrane/example/source/example.tgz

I hope this link works....

This example should be more recent. If you're running PHP4 replace
public with var.

> 
> Justin Patrin wrote:
> 
> > On 6/29/05, PHPDiscuss - PHP Newsgroups and mailing lists <nyshab@gmail.com>
> > wrote:
> > > Hello, I was trying to get to work an example from
> > > http://www.akbkhome.com/svn/pear/DB_DataObject_FormBuilder/examples/
> > > I didn't found the author, but it seems a very good FormBuilder example of
> > > use. After setting the configuration options and point to
> > > http://localhost/example/index.php
> 
> > I believe the author is Alan Knowles. I didn't know he had an example up.
> 
> > >
> > > Index.php
> > > ...
> > > // Include the FormBuilder class definition
> > > require_once('DB/DataObject/FormBuilder.php');
> > > // Create the FormBuilder object BY REFERENCE and pass the DataObject
> > > $formBuilder =& new DB_DataObject_FormBuilder($obj);
> > > // Create the form, make sure to always make a REFERENCE to the
> > > FormBuilder object!
> > > $form =& $formBuilder->getForm($_SERVER['REQUEST_URI']);  // This is the
> > > line
> > > ...
> > >
> > > I get this:
> > >
> > > Fatal error: Call to a member function populateOptions() on a non-object
> > > in c:apachephppearDBDataObjectFormBuilder.php
> > >
> 
> > A line # would be handy as well. It looks like you're using parts fo a
> > new release of FormBuilder and parts of an old release. Are you sure
> > your include_path set up right?
> 
> > > Do I need to set up something else? I'll appreciate any comments or help
> > > on this.
> > >
> > > I'm using
> > > Microsoft Windows XP [Version 5.1.2600] (SP1)
> > > PHP 5.0.5-dev (cli) (built: Jun 23 2005 10:28:39)
> > > Apache/2.0.52 (Win32)
> > > DB_DataObject             1.7.14   stable
> > > DB_DataObject_FormBuilder 0.17.2   beta
> > > HTML_QuickForm            3.2.4pl1 stable
> > >
> 
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Justin Patrin

-- 
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic