Re: Leaving tmp_var intact inside template
city crew <[email protected]> Tue, 29 Jul 2008 07:29:51 +1000
| Newsgroups | gmane.comp.lang.perl.modules.html-template |
|---|---|
| Message-ID | <[email protected]> |
> Date: Mon, 28 Jul 2008 17:13:58 -0400> Subject: Re: [htmltmpl] Leaving tmp_var intact inside template> > city crew wrote:> > > 2. store template output into a scalar and to a regexp subst on the > > scalar before printint that to the file.> > > > my $templateRef = $template->output;> > $templateRef =~ s/<TMPL_/<TMPL_/g;> > print TEMP $templateRef;> > > > As I am writing this I think I'm going to go with solution 2 as it > > outputs the file and doesn't require any filter on loading the second > > template.> > We do something similar to your #2. We use a slightly more obvious > syntax though. We use <TMPL_VAR> for things that are being loaded on the > first pass and <DYN_VAR> for things on the 2nd pass. I like that, I was experimenting with !TMPL_VAR but yours seems more semantically appealing. (I'm practicing my impressive technical speak there...) > > Just FYI, I've heard this technique named a couple of different things, > in case you want to impress anyone :) It's usually called "2 pass > templating" or "Write-thru cache templating". Nice! I'll try impress my wife with "Write-thru cache templating", maybe I'll get lucky. =o) Grant > > -- > Michael Peters> Plus Three, LP> _________________________________________________________________ Want to help Windows Live Messenger plant more Aussie trees? http://livelife.ninemsn.com.au/article.aspx?id=443698 ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Html-template-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/html-template-users