Re: Is Pear RADy ?
| From: | Justin Patrin | Date: | Thu, 22 Jul 2004 16:35:13 +0000 |
| Subject: | Re: Is Pear RADy ? | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13804@lists.php.net to get a copy of this message | ||
On Thu, 22 Jul 2004 10:50:42 +0200, Olivier Guilyardi <ml@xung.org> wrote:
> Justin Patrin wrote:
> > On Tue, 20 Jul 2004 09:03:17 +0200, Olivier Guilyardi <ml@xung.org> wrote:
> >
> >>I'm interested ; I'm gonna use that for the prototype I'm about to code.
> >>We shall make it better ; what about calling it DB_DataObject_Pager, or
> >>some other shorter name ?
> >
>
> > Well, I called it what I did because it's built on FormBuilder. Part
> > of the "niceness" of it is that it also uses the link display
> > functionality in the outputted table. I'm sure I could make it better
> > to use, possibly even use Structures_DataGrid for the output.
>
> Definitely. Structures_Datagrid seems powerful (thanks Klaus).
>
> > You can also affect how the table is displayed and how the form is
> > displayed / works through the config options of FormBuilder. Such as
> > defining the fields to render or the use editable fields *per-table*.
> > You just add it to the DataObject and it magically appears in the
> > form.
>
> What about using HTML_Menu to improve the tables menu you've set up ?
> Possibly with some nested levels (a tree like thingy).
>
Good idea, but how do you nest them? Tables can be linked any which
way. I ended up just showing the link-to tables beneath every table.
> In addition, the formbuilder lacks support for sql enumerations (ex :
> status ENUM ('customer', 'prospect')) ; it should generate a drop down
> list (<select>) in those cases.
>
Yes, this would be good, but I don't think that DB_DataObject even
supports enumerations... You could create a table that the field links
to and it can create a select element for you.
> There also could be some interesting feature making use of foreign keys.
> It may be somewhat tricky, though. Say you want to create a new Bill
> object, the form could present you with the list of all Contacts, since
> the 'bill' table contains a field like : contact_no integer REFERENCES
> contact (contact_no).
>
> Analysing the table structure may not be sufficient for this though
> (AFAIK MySQL does not support foreign keys anyway) Then what ? Xml
> database schema ? Or adding a little method (after ###END_AUTOCODE) to
> the DataOjects that want to make use of such foreign keys ?
>
Have you looked into the links.ini in the DB_DataObject? FormBuilder
already supports select generation for foreign keys (links), you just
have to set it up in DB_DataObject. In addition, you should set
display fields for the tables (see selectDisplayFields in the docs).
Check here for some docs work-in-progress:
http://opensource.21st.de/tiki-index.php?page=DB_DataObject_FormBuilder
A word of warning, these docs are based on the newest CVS version.
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--