Re: [Phplib-users] template extensions
Brought to you by:
nhruby,
richardarcher
From: Richard A. <rh...@ju...> - 2003-01-14 03:59:43
|
At 21:42 -0500 13/1/03, Mike Gifford wrote: >In reasearching this I noticed that there were a number of other >extensions to phplib here: >http://pathtech.mirrors.phpclasses.org/search.html?words=phplib&go_search=1 That web site says: Please login to access. Personally I have no intention of signing up for more spam just to see if the classes are worth including in PHPLIB. Feel free to download them and post them to PHPLIB's patches tracker on SourceForge, where I (and other developers) will look at them and merge them if I think they are nifty enough :) >Evan's thought was that it would be really, really nice there were hooks >for calling functions right in the templates, allowing our pages to look >something like: There are a couple of patches to template.inc in the Patches tracker. I have no intention of merging either caching or functions into the mainline template class, simply because I don't think they belong there. The philosophy of the template class is to separate the data presentation from the application logic. template.inc does this, and does it very well (and with good performance into the bargain). Once you start adding scripting to a template class, where do you stop. You finish up re-implementing PHP within PHP. And you open up a whole lot of security concerns which designers shouldn't need to worry about. And you kill your performance. I see three options for someone who wants this level of scripting: 1. drop the template class and use PHP (which is after all just a very advanced template engine with scripting capabilities). Add a "<? include("my_functions.inc"); ?>" to the top of the file, and the rest of it looks like a template with <?, ?> as the template delimiters. 2. use one of the other scriptable template engines (template.inc is a standalone component of PHPLIB and can easily be replaced with say smarty). 3. patch your template.inc with one of the patches from the SF tracker. This is getting harder to do as time goes by because the patches are becoming out of sync with the mainline template class. If you merge the patch into the current template.inc, please repost a new diff to the patches tracker :) ...R. |