Re: Account Request : phpHtmlLib

From: Date: Sat, 14 Jun 2003 02:19:16 +0000
Subject: Re: Account Request : phpHtmlLib
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17438@lists.php.net to get a copy of this message
Finally had a chance to look through phpHtmlLib. From what I can see, it is a extremely heavy way of representing all HTML elements. + a few cute widgets (groups of HTML elements) One of the key features it shares with HTML_Common, is that it uses private variables to store _attributes, _tag, _content. It then goes on to use setters/getters for all these variables, and adds a few utility ones (in some of the upper level classes), like $htmlelement->set_class('someclass'); $htmlelement->set_id('someid'); (at this point, I ran screaming and shouting, for god sake, HTML elements are so simple, why not just have public variables, and save memory, speed by just using variable access, rather than setters/getters..) On top of the ContainerClass + XML Class, which is pretty similar to HTML_Common, except they actually implement renderers (toHtml), ontop of this, is the huge array of HTML_Tag_A, HTML_Tag_BR, HTML_Tag_IMG etc. - while cute, a 1600 line file, to define stuff that could be done in a few lines with somethink like a vistor class, and with no major benefits... While I'm certain, there are people who are out there and like developing like this, and I can see some value of it being in pear (I dont think I'd be running to use it ;) Looking at it, I would say = merge what's relivant into HTML_Common (make a fat class fatter), = rethink the Tag_A/BR/IMG... classes - just use a static array for flag lookup, based on tags. = put the widgets under use the HTML_Widget_* = change render to toHtml? - I think this is what PEAR has mostly used.. I've not really examined the SVG classes, but I didnt find much more than a set of almost empty clases representing all the SVG tags.. Have to admit, it makes HTML_Lite (what was HTML_Element/HTML_Template_Flexy_Element) seem like a good proposition.. Flame away :) - (on the upside, it's well documented, and follows a consistent standard, although not pears') Regards Alan -- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

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