Package Proposal: HTML_Template_Dummy

From: Date: Fri, 18 Jul 2003 18:55:47 +0000
Subject: Package Proposal: HTML_Template_Dummy
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-18390@lists.php.net to get a copy of this message
Hi, all -- Yes, I'm serious; no, the name is not a joke (well, the name is an obvious reference to Smarty ;-). This is a template class for those of us that think it is perhaps a misguided effort to learn a new templating language just so we can separate business logic from display logic.
    http://www.phppatterns.com/index.php/article/articleview/4/1/1/
    http://www.massassi.com/php/articles/template_engines/
HTML_Template_Dummy does three main things:
    - accepts variables and objects for parsing through to a template via the assign() method
    - parses and returns the template contents via the fetch() method
    - parses and displays template via the display() method
The Big Bonus: You don't need to learn a new language or markup to create a template. The template language is PHP, and the template file is a regular PHP file (you may wish to use the suffix ".tpl.php" to indicate it is display logic and not business logic). You can also extend HTML_Template_Dummy directly to include timesaver display methods (e.g., generating radio buttons, stylesheet links, value processing, and so on). See the attached .html and .php files for a quick documentation page and the class itself. (Incidentally, the .html file was generated from a preliminary version of Text_Wiki -- that one looks to be coming along just fine.) I understand we don't need *yet another* template engine in PEAR; however, this proposal was too good to pass up. Frankly, I don't figure anyone will vote for it (because we're all tired of the template wars). Regardless, I wanted to try, because I do think it's a useful addition that speaks for us "non-template-engine" folks who still want to separate business logic from display logic. Thanks, as ever, for your time and patience. :-) -- pmj

Attachment: [application/text] HTML_Template_Dummy.php
« previous php.pear.dev (#18390) next »