[PEPr] Comment on HTML::Template_Savant

From: Date: Thu, 03 Jun 2004 17:58:00 +0000
Subject: [PEPr] Comment on HTML::Template_Savant
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-29956@lists.php.net to get a copy of this message
Harry Fuecks (http://pear.php.net/user/hfuecks) has commented on the proposal for HTML::Template_Savant. Comment: Just throwing in 2c; think Savant is a good addition to PEAR _because_ the templates are written in PHP itself. As such it's "low risk" for users - there's minimal lock in to the template syntax - if someone decides to ditch Savant at a later date, the templates can, more or less, still be used. That said, also think that http://sourceforge.net/projects/php-templates/ (a PHP extension for templating) should make PECL some day, so perhaps I'm strange. On the general subject of templating, would like to recommend some reading: http://wact.sourceforge.net/index.php/TemplateView - this document is meant as an objective study of "the template problem" and I can't recommend reading it enough as I think it helps clarify the issues with template engines in PHP and may in making decisions about PEAR's template engines. [Note I've made some contribution to the page but am one of many authors - please feel free to make further mods / additions] That TemplateView page identifies a number of critical areas which can be used to describe a template engine, these being; - Marker Style (the template syntax) - API Style (how you work with the template engine from the calling PHP script) - Data Population (how data reaches the template) There are also "Good Template Smells" defined at http://wact.sourceforge.net/index.php/GoodTemplateSmells (this was proposed by Jason @ phpcomplete.com) which further help in evaluation. Savant can be categorized as; - Marker Style: Scripting Tags (i.e. PHP) - this makes it unique in PEAR - API Style: Pinhole API - believe all the PEAR engines use this (compare to DOM, for example, and "getElementById") - Data Population - push - goes from the PHP script to the template (by contract believe Flexy uses a mix of push and pull, for forms while XIPE seems to be a kind of a "pull" style - include the compiled template then variables you defined in it's scope get there) Similar categorization could be done for the other PEAR template engines to help analyze how each distinguishes itself from the other. One critical point I think for PEAR is it should be possible to unify the result of the the HTML_* packages for use in a single PEAR template engine - know there's some work happening in that direction, with Flexy and Quickform in particular - seems like a deciding point in designing a "grand unified template engine". Anyway - just rambling ;) Proposal information: http://pear.php.net/pepr/pepr-proposal-show.php?id=83 -- Sent by PEPr, the automatic proposal system at http://pear.php.net

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