Re: Formbuilder and multiple links?

From: Date: Mon, 20 Dec 2004 20:29:33 +0000
Subject: Re: Formbuilder and multiple links?
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16349@lists.php.net to get a copy of this message
On Tue, 21 Dec 2004 01:36:13 +0530, Jacob Singh <jacob@pajamadesign.com> wrote: > Hi Justin, > > I wrestled with this for about 2 hours, not understanding why one link > worked, but not the other. I think the documentation is unclear on this > point. Where in the process could I interrupt form builder to add these > keys? I don't want to put the attribute in the dataobject itself. The > reason is I am building a wrapper for formbuilder, so everything needs to > work by reference and be dynamic. Plus, I'm not too keen on putting > properties inside the dataobject that don't directly have to do with it... > I like the idea of the Ini file, but I don't see any examples of this. > > I'll shove 'em in DO if this is the only option though. > Thanks for you help, please let me know if there is a "plan B" here. Well, the FB ini file was scrapped. You can't set it in the FB since this is different for different DOs. You need to set it in the DO, sorry. (I don't think there is another option right now). > > > Justin Patrin wrote: > On Mon, 20 Dec 2004 22:47:14 +0530, Jacob Singh <jacob@pajamadesign.com> > wrote: > Can one link to 2 different tables using DB_DataObject_Formbuilder? I have > an account table which holds Credit Card info. it links to the user table on > account.user_id = user.user_id and account.account_type_id = > account_type.account_type_id. So I want the form to show the username (not > the user_id) and the account_type_name (not the account_id). I can get it to > show just the account_type_id and user_id (in select boxes), and I can get > it to show just the username (by setting linkDisplayFields), but I can't > seem to get it to link to both tables. the links are fine, I've tested them. > My code: $fb->linkDisplayFields = array ("user_id" => "username"); if > I use: > $fb->linkDisplayFields = array ("user_id" => "username", > "account_type_id" > => "account_type_name"); the script tries to select username from > account_type! Any ideas here? The linkDisplayFields stuff should be in the > DataObject classes. You also don't need keys, just list the fields you want > displayed. For example, in the User DataObject: class DataObject_User > extends DB_DataObject { //auto-gen stuff var $fb_linkDisplayFields = > array('username'); } > Thanks, Jacob > -- Justin Patrin

« previous php.pear.general (#16349) next »