Re: a question to HTML_Template_IT/ITX maintainers

From: Date: Thu, 19 Sep 2002 14:45:03 +0000
Subject: Re: a question to HTML_Template_IT/ITX maintainers
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-9211@lists.php.net to get a copy of this message
I've been working with the current IT class for a while now and I like the way it's templates work. I also like your improvements a lot! I think it would be great to see this integrated into the current IT class (especially hideBlock()). Having worked with the current IT class I have a few concerns that I am curious if you addressed them or not: 1. can variables be replaced more than once in the same template? (i.e.: {VAR1} shows up twice in the template in different blocks and both are replaced with the same value passed into setVariable()). 2. can I call get() or show() and have the class do all the parsing for me? This way I don't have to know the names of the blocks in the template and parse each one by hand (setCurrentBlock() and parseCurrentBlock()), IT should handle all that for the programmer (I'm not suggesting making the set and parse functions private as they would need to be used in some cases). It kind of works that way now, but I've been able to break the current implementation. Adam > Greetings! > > Some time ago (when IT[X] was effectively not maintained) I borrowed > it from PEAR and made some kind of private fork from it --- I liked > its API and "ideology" very much. > > Now I have a class which is (mostly) API compatible with ITX but is > alot cleaner, faster and well-tested in production environment. > > Advantages over ITX: > * Transparent caching of parsed templates. I found out (the hard > way) that findBlocks() call is VERY expensive. > * faster parse(): fewer preg_replace() calls > * Addition of "global" variables, hideBlock() method (an opposite of > touchBlock())... > > Disadvantages: > * One class instead of IT/ITX hierarchy > * Callback functions are not supported > * Comments and error messages are in Russian :] > * Private API, variables and some subtle quirks are NOT compatible > with ITX > > As the class is effectively a rewrite, it is impossible to provide > simple patches for IT[X]. So a question: are you interested in > merging my work into the existing ITX code? > > -- > ó Õ×ÁÖÅÎÉÅÍ, áÌÅËÓÅÊ âÏÒÚÏ× > ÏÔÄÅÌ ÉÎÔÅÒÎÅÔ-ÐÒÏÅËÔÏ× ïïï "òä÷-íÅÄÉÁ" > http://www.rdw.ru > http://www.vashdosug.ru > > > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php --------------------------------- Adam Morton Developer - Web Technology Group Appalachian State University http://phpwebsite.appstate.edu adam@tux.appstate.edu

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