Re: populateOptions() on a non-object
| From: | (PHPDiscuss - PHP Newsgroups and mailing lists) | Date: | Thu, 30 Jun 2005 04:31:08 +0000 |
| Subject: | Re: populateOptions() on a non-object | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19836@lists.php.net to get a copy of this message | ||
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
db_date_format = 1
date_element_format = d/M/Y
hide_primary_key = 1
add_form_header = 0
folder tree under htdocs\SFBExample\
------------------------
classes/
Category.php
formbuilder.ini
formbuilder.links.ini
Manufacturer.php
Product.php
sql/
schema.sql
schema.gif
config_inc.php
dataObject.ini
index.php
(files were not modified except dataObject.ini)
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
Hernan
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
> >