Re: [Templates] basic VARIABLES question

[prev] [thread] [next] [Date index for 2005/01/03]

From: Perrin Harkins
Subject: Re: [Templates] basic VARIABLES question
Date: 21:22 on 03 Jan 2005
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

[Templates] basic VARIABLES question
Sean T Allen 19:03 on 03 Jan 2005

Re: [Templates] basic VARIABLES question
Perrin Harkins 21:22 on 03 Jan 2005

Re: [Templates] basic VARIABLES question
Sean T Allen 22:42 on 03 Jan 2005

Re: [Templates] basic VARIABLES question
Perrin Harkins 22:51 on 03 Jan 2005

Re: [Templates] basic VARIABLES question
Sean T Allen 23:05 on 03 Jan 2005

Re: [Templates] basic VARIABLES question
Perrin Harkins 23:25 on 03 Jan 2005

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52