Re: DataObjectsFormBuilder - tripleLinks
| From: | Alexander Petri | Date: | Tue, 16 Nov 2004 21:23:59 +0000 |
| Subject: | Re: DataObjectsFormBuilder - tripleLinks | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15574@lists.php.net to get a copy of this message | ||
Alexander Petri wrote:
Justin Patrin wrote:okay now i found out that i can access to those "Element" with __crossLink_user_to_hobby_a and __crossLink_user_to_hobby_b but again no checkboxes appear...On Tue, 16 Nov 2004 16:03:34 +0100, Alexander Petri <alex.petri@gmx.de> wrote:okay i tried to do this: (i have 2 questions to the user)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$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 ;-))