Re: QuickForm 3.0 news: renderers

From: Date: Thu, 13 Mar 2003 15:59:00 +0000
Subject: Re: QuickForm 3.0 news: renderers
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-14252@lists.php.net to get a copy of this message
Alexey Borzov wrote:
13 Март 2003 18:20, Alan Knowles написал:
ouch.. - is that essential - as I can see it's likely that I'm going to end up with lots of little cute widgets doing weird things that I want to plug in (that are probably not that usefull to anyone else) - like [text input] [textinput] [button] - where you press the button - does a popup select and fills in the left two.. - I was hoping to impement that as a 'private add-on' to quickforms.. = does this mean that you have to hack the renderer to make it work, or are the elements going to be able to stay seperate with a minimal knowledge of outputing...
If your element is just a fancy group, then it can probably extend 'group' and use its rendering logic, if it is like 'date' then you can just write your own toHtml() method and your element will use default rendering logic. When I said 'special rendering needs' I meant 'really weird ones': consider the difference between <input type="text" />, <input type="hidden" /> and headers in form. phew :) - doesnt sound that bad :)
This does sound like a case where treecc would be usefull - Aspect orientated coding it designed to try and sort out this Visitor class interdependant mess... - maybe worth a look..
Please provide a link to this treecc stuff. :] may be an overkill.. - but heres the link
http://www.southern-storm.com.au/treecc_essay.html (totally confusing - but at least an introduction) http://www.southern-storm.com.au/treecc.html (download - it supports PHP generation) A base treecc file which creates the nodes (think of the quickform elements with only details on the variables.) http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/php-sharp/PHPSharp/PHPSharp/Nodes.tc?rev=1.1.1.1&content-type=text/vnd.viewcvs-markup An operation (eg. standard method) defined for all classes defined in the previous nodes(classes). http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/php-sharp/PHPSharp/PHPSharp/Nodes.csEmit.tc?rev=1.1&content-type=text/vnd.viewcvs-markup the idea is that it gives you the freedom to group your definitions either like a standard class - eg. with all it's methods. or as above, group all the method defintions in a single file, - or have a mix of the two - the code builder then checks that all the required methods are defined for all the classes correctly, (either via inheritence or coded) and builds the classes the build.sh file shows the usage of treecc (pretty simple .. - you could just use it with a *.tc I think. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/php-sharp/PHPSharp/PHPSharp/build.sh?rev=1.4&content-type=text/vnd.viewcvs-markup May be an overkill - but it's an interesting tool. Regards Alan -- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

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