Re: Idea for a new Package - Chained Selectors

From: Date: Sat, 18 Sep 2004 17:59:57 +0000
Subject: Re: Idea for a new Package - Chained Selectors
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-33437@lists.php.net to get a copy of this message
Hi, Klaus Guenther wrote:
Probably this would be the best thing to do.
Certainly not.
You know, you're absolutely right. I tried to give you HTML_Select, though, but you didn't want it. I assume that is because you consider it unnecessary when HTML_QuickForm has such excellent support for select (including hierselect) and adding a dependency isn't such a brilliant idea (or duplicating the code, for that matter). In this you are perfectly right. Which is why I left HTML_Select in its original state.
It is a non-trivial job to make HTML_QuickForm depend on HTML_Select. All QF elements are (and should be) subclasses of HTML_QuickForm_element. Now, PHP (even PHP5) does not support multiple inheritance, so we can't just go ahead and make HTML_QuickForm_select a subclass of both HTML_QuickForm_element and HTML_Select. One possible approach is making HTML_QuickForm_select a Decorator using HTML_Select object internally. But it will require a big amount of code and will definitely *not* improve performance. Seems like both Bertrand and myself have better things to do than to write such code. So for now we are stuck with two copies of essentially the same class. Well, that was your choice so it will be honest if you assume the responsibility as well.
However, if someone wants to play around with it and update it so that it can be used properly, I think it wouldn't be such a bad idea. After all, currently it is a legacy release that has no maintainer (I am merely a nominal maintainer).


« previous php.pear.dev (#33437) next »