Re: DB_DataObject_FormBuilder - presentation outdated?
| From: | Justin Patrin | Date: | Tue, 26 Dec 2006 17:20:33 +0000 |
| Subject: | Re: DB_DataObject_FormBuilder - presentation outdated? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26201@lists.php.net to get a copy of this message | ||
I'm ccing the pear-general list, you should send further help requests there.
On 12/25/06, Chad Johnson <chad.d.johnson@gmail.com> wrote:
Hi! Merry Christmas!
The PEAR web site's captca is not working, so I'm emailing you directly.
Been looking into your PEAR package which looks awesome, but I'm following
the PDF presentation at
http://opensource.21st.de/static/formbuilder/rapidprototyping-kr.pdf
and
a) I'm not able to get anything to show up with
$review = DB_DataObject::factory('review');
$customer = DB_DataObject::factory('customer');
$review->book_id=5;
$review->joinAdd($customer, 'INNER');
$review->selectAdd('customer.name');
$review->find();
while ($review->fetch()) {
echo $review->title.' (a review by '.
$review->name.')<br>';
echo $review->description.'<hr>';
}
which is in the presentation - I get a blank page with no outputted HTML. I
created a demo.links.ini file as it said to do, and I stuck it in both the
schema directory and the parent directory of that, but nothing happens. I
also tried modifying the ini file that was generated with the
createTables.php script, and that did nothing.
Looks fine to me. Is PHP crashing perhaps? Maybe you should try an
error handler? (http://pear.reversefold.com/dokuwiki/doku.php?id=pear:error_handling)
One last thing is to turn on DB_DataObject's debugging code.
DB_DataObject::debugLevel(5);
You can also use 1-4.
Lastly...is there any data in the tables?
b) I'm not able to get any fields to show as select lists - they stay as text fields. I addedYour links.ini isn't being read, then. Remember, it needs to be named the same as the db.ini (db.links.ini). Also, you can override the links() function in the DO, such as: function links() { return array(array('customer_id' => 'customer_id')); }
var $fb_linkDisplayFields = array('name'); to the Customer class, but that did not help.That makes the customer DO show the name field when it is linked to. It doesn't change whether the link is showed as a select.
c) I'm not able to change the text next to the fields via
var $fb_fieldLabels = array(
'customer_id' => 'Customer',
'book_id' => 'Book');
If that's not working then you have bigger problems. Sounds like the
classes you're using aren't being picked up. Turn on DB_DO's debugging
and see what it says.
I basically can only get half the stuff in the presentation to work, and I'd really like to use this package. Any quick solutions to these problems?Nope, it all looks like it should be working. -- Justin Patrin