Re: Virtual links vs. real links
| From: | Justin Patrin | Date: | Sat, 01 Jan 2005 04:23:17 +0000 |
| Subject: | Re: Virtual links vs. real links | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16550@lists.php.net to get a copy of this message | ||
On Fri, 31 Dec 2004 16:42:41 -0800, Ken Restivo <ken@restivo.org> wrote:
> Studying
> http://opensource.21st.de/tiki-index.php?page=Beyond+Advanced
>
> I'm curious why I would use virtual links as opposed to "real" links?
>
> In other words, instead of doing a virtual link, why wouldn't I just add it to my
> links.ini file and let FB figure out that it's a link? It's not like it'd make much
> sense to have a link to another table, but not have that tables PK in the current table anyway. Or
> would it?
>
Well, the point of a virtual link was that it was for a virtual field.
A virtual field (at least how I do it) should have no entry in the db
ini file. So it makes sense that the virtual field has no entry in the
links ini file. So I override the links() function to add it.
> Also, I can't see much use for making a text field turn into a dynamic link in case where
> "links" is typed in, but I could easily see a use for the converse: switching from a link
> to a regular text field if the value is "Other"... and in fact I will likely end up doing
> that if there isn't some example of it already out there that I can cut and paste.
>
Well, the idea I had was for the value of some *other* field to change
whether a field was a text box or a link. So, after initially creating
the record, when you edit it if a certain field was set a certain way,
the dynamic field becomes a link.
Basically "Beyond Advanced" is just a place where I put all of my
ideas. Most of them I've used, but Dynamic Links I have no yet used.
It was just an idea I had.
> Or, it seems like virtual fields would be useful for a combo field: a combination select box
> and "other" box. The insert() and update() fields would then check to see if the select
> box's value is "Other..." and insert the value of the virtual "other" field
> in that case, and return its last_insert_id and put that into the selectbox's field and then
> insert/update that... ugh. Again, I'm surprised if there isn't example code of that online
> already, but if not I don't think it'll be to difficult to cook up.
>
This sounds like a great idea. If you make any examples or tutorials
for this I'd be glad to add them to our docs. :-)
--
Justin Patrin