Re: [Phplib-users] template extensions
Brought to you by:
nhruby,
richardarcher
From: Aric C. <gre...@pe...> - 2003-01-14 02:59:37
|
It seems to go against the general idea of templates: to separate code from presentation. That said, this seems like a really cool idea. It could make the whole code base merely an API that is called from the templates, thus letting the templates determine the whole structure of a page, whereas now the code decides what template goes where, which can be really limiting to the guy doing the site layout. It would also be nice for the templates to be able to use this to tell the code what to do in certain cases. For instance, what if the template has a 4 by n grid. But the designer wants it changed to, say 6 wide. Currently you'd probably have a nested set of blocks (one for horizontal, one for vertical) and the code would determine how many wide to go, so the programmer would have to go in and change that. With this you could just have something like this: {setmatrix(4)} <!-- BEGIN matrix --> <img src="block.gif"> <!-- END matrix --> And the code would know what to do. ----- Original Message ----- From: "Mike Gifford" <mi...@op...> To: "phplib mailing list" <php...@li...> Cc: "Evan Hughes" <eh...@ju...> Sent: Monday, January 13, 2003 6:42 PM Subject: [Phplib-users] template extensions > 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 > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: FREE SSL Guide from Thawte > are you planning your Web Server Security? Click here to get a FREE > Thawte SSL guide and find the answers to all your SSL security issues. > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > |