RE: [PEAR-DEV] yet another template
| From: | Jean-Michel POURE | Date: | Thu, 08 Nov 2001 08:32:39 +0000 |
| Subject: | RE: [PEAR-DEV] yet another template | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-2633@lists.php.net to get a copy of this message | ||
Dear Naoki and all,
My class supports variable replacement, BLOCK, and recursive LOOP with ALT block feature. Variable replacement can be accoumplished by <?=$var?>. Recursive loop is somewhat difficult but can be accumplished by making object containing object and @foreach(). I added "@" to suppress the error output. The advantage of using AT.php is that template syntax is little easier and with its setValue() and setChildValue(), we can avoid using same variable and accidentally replace variable used by template. The drawback of it is that its template syntax is not standard and needs template parsing. So, I had been trying to implement "parse once, save it and reuse it" system, but now I think I should start building something more intelligent.I am working on a parse-once-use-many template strategy. The original work is taken from http://sourceforge.net/projects/html-parser project, written by Anton Kalmykov (atnon@concord.ru). Html-parser is already able to parse any existing HTML page into a table. I am trying to pearize the class to parse any HTML document into an XML class which could then be manipulated with PEAR Tree. This has two advantages: 1) Html-parser could be used to transform any existing HTML document into an XML template. 2) XML based templates are light-fast compared to search/replace strategies. Any feedback on this idea?
Maybe something like PhpLens that you talked about, or something that can handle PEAR::DB result object to dynamically create user interface.I would welcome your help. I am finishing a commercial project dealing with Japanese translation (thanks for your class, it came at the right moment). From December on, I will be available during 2 months full-time to work on EAR Portal. I really need a powerful solution to speed up my developments and improve my PHP knowledge.
I'm also new to PEAR, so I am not sure of my technical analysis, too. That's why we will make it.Cheers. Jean-Michel POURE