Re: [Phphtmllib-devel] Usability issues
Status: Beta
Brought to you by:
hemna
From: Walter A. B. I. <wab...@bu...> - 2002-06-06 18:06:05
|
On Thu, 2002-06-06 at 10:43, Walter A. Boring IV wrote: > Howdy again, > So I didn't think about this when I sent my previous email, but you > can't have a function that is named the same as a class. So the > functions as you listed them as wrappers won't really work. I think we > could possibly just build more of the html_* functions ? > > Walt ---So I just tried to do this and php doesn't complain about having a function named the same as a class. In fact it works fine. But I'm not sure its something we should do. First of all it kinda blurs the line between functions and classes. How would you debug a problem with an accidental missing "new" in front of the tag, when you meant to use it? That would be hard to find. It does make for more readable code, but all it really does is enable you not to use "new" in front of the name. One way to solve this is to enable the constructor of the objects handle n number of content items. The drawback is that you would still have to do "new" new SPANtag(array(), "foo", "bar", "blah blah"); This also has an issue. The current API of the libs is that the constructor of the html tag's 3rd param is a flag to set the newline after opentag flag. This was done to help collapse the content of a tag on the same line as the tag. But with 2.0.0 there is a new method called set_collapse() which will collapse the tag's content onto the same line (even nested objects as content). So do we break the API for 2.0 ? How many folks are actually using the 3rd param to the constructor? The other option is to modify the html_* functions. But that would also break folks that are using them now. I use them heavily. Any thoughts? Walt |