Re: [htmltmpl] Leaving tmp_var intact inside template
Brought to you by:
samtregar
From: Michael P. <mp...@pl...> - 2008-07-28 21:14:54
|
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. 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". -- Michael Peters Plus Three, LP |