[Phplib-users] template extensions
Brought to you by:
nhruby,
richardarcher
From: Mike G. <mi...@op...> - 2003-01-14 02:41:54
|
Hello, A colleague of mine asked me about extending phplib templates so that it would be possible to pass functions and variables back through the template variables. I didn't think that this was possible with the current version of the code, but wanted to bring forward the idea here to see if someone had already done this and if there was interest within the community. 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 And I wanted to see if there was any movement to build these extensions into the phplib code base. 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: article.tpl: ----------------- {header} <body> <table> <tr> <td><!-- leftbar--> {Poll()}<br> {MailingListSignup()}<br> {RSSFeeds()}<br> </td> <td><!-- main content --> {Article($ArticleId)} </td> <td><!-- Right bar --> ... ----------------- All of those functions (stuff in curlies with '()'s after the name) would resolve to a php function that would be called (or maybe a file that would be evaluated as php, or something =). That would really clean up the content files, and provide really, really nice modularization. An instance that occured to me is that it seems silly to have have multiple template variables for something like {BANNER1} ... (BANNERn), when you could have a {BANNER(1)} tag to pass along that info to a function. Mike -- Mike Gifford <mi...@op...> OpenConcept Consulting http://www.openconcept.ca |