Re: [Templates] basic VARIABLES question
[prev]
[thread]
[next]
[Date index for 2005/01/03]
On Mon, 2005-01-03 at 14:03 -0500, Sean T Allen wrote:
> $t = new Template( VARIABLES => { blah } );
>
> $t->process( , OTHERBLAH );
>
> does it do:
>
> create template
> doing substitutions for blah
>
> process what was left over after blah using OTHERBLAH
>
> so that if i ran
>
> $t->process( , OTHERBLAH1 );
> $t->process( , OTHERBLAH2 );
> $t->process( , OTHERBLAH3 );
>
> the initial blah variables are only dealt with once?
That looks like you're approaching it with an HTML::Template mentality.
With HTML::Template, you make a new object for each template and the
object *is* the template. With TT, the object is a TT processor, not an
individual template. When you call process(), you tell it which
template to work on and *all* of the data to use (not multiple calls to
add data like HTML::Template), and it does all processing at that time.
If you really wanted to do a multi-pass thing, you would have to make
sure to use a different style of tags on each pass, and store the
results in a scalar which you would pass in the next time you call
process(). It's very unlikely that this is really what you want.
- Perrin
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
 |
Re: [Templates] basic VARIABLES question
Perrin Harkins 21:22 on 03 Jan 2005
|