Within a TT file, I'm hoping to be able to create a BLOCK 
that contains other TT commands to be passed back to my 
program (which is parsing the template) to be compiled 
later.  Probably better illustrated...

For instance:


TT FILE
:::::::::::::::

TT commands go here

[% BLOCK myblock %]
        [% IF a == 1 %]
                Hello
        [% END %]
[% END %]
[% myRememberMeCommand(myblock) %]

More TT commands go here


PERL SCRIPT
::::::::::::::::

%data = (
        myRememberMeCommand => sub { $cmd = shift; },
);
my $template = Template->new({
        OUTPUT => \$output,
});
$template->process($file, \%data);



I'm hoping to be able to $template->process(\$cmd) then at
any time, and have the TT statements that were in the block
be parsed at that time.  To do that, they must pass unparsed
into myRememberMeCommand.

Should I just escape the brackets, or is there a better way 
-- something like a [% BLOCK 'myblock' %]?

--drew



_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to