Re: DataObjectsFormBuilder - tripleLinks

From: Date: Tue, 16 Nov 2004 21:14:08 +0000
Subject: Re: DataObjectsFormBuilder - tripleLinks
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15573@lists.php.net to get a copy of this message
Justin Patrin wrote:
On Tue, 16 Nov 2004 16:03:34 +0100, Alexander Petri <alex.petri@gmx.de> wrote:
i have three tables: user, hobbies, user_2_hobbies now i want to generate a form where the user can add his personal data and choose his hobbies which are given from the hobbies table this must be checkboxes - because he can select more than one hobby the user_2_hobbies table is my n:m connection which only contains the IDs of both tables... Is it possible to autogenerate a Form like this? can anyone give me a small example and give a hint how to fill my *.links.ini file?
That would be a crossLink, not a tripleLink. Have you seen the online docs? http://opensource.21st.de/tiki-index.php?page=Formbuilder+configuration+options#id534757 For the links.ini file, go here: http://pear.php.net/manual/en/package.database.db-dataobject.intro-relations.php
okay i tried to do this: (i have 2 questions to the user) $this->fb_crossLinks = array( array('table' => 'user_to_hobby_a', 'fromField' => 'user_id', 'toField' => 'hobby_a_id'), array('table' => 'user_to_hobby_b', 'fromField' => 'user_id', 'toField' => 'hobby_b_id') ); // i put this in //function preGenerateForm(&$fb) {} but the crosslink part of the form doesnt appear what else must i do, that i'm going to be happy ;-))

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