On 5/20/05, Bruce McKenzie <[EMAIL PROTECTED]> wrote:
> sub cgiapp_init {
> my $self = shift;
> $self->tt_config( TEMPLATE_OPTIONS => $Config_TT::config),
> $self->tt_params(%$Config_TT::subroutines);
> $self->tt_params(username => $username);
> $self->tt_params(PRE_PROCESS => 'macros.tt2');
> # params are ok, but no macros are processed
> }
You need to pass the PRE_PROCESS directive as part of the TEMPLATE_OPTIONS hash
sub cgiapp_init {
my $self = shift;
my $ttconfig = $Config_TT::config;
$ttconfig->{PRE_PROCESS} = 'macros.tt2';
$self->tt_config( TEMPLATE_OPTIONS => $ttconfig),
}
Anything you put into TEMPLATE_OPTIONS will be passed to Template
Toolkit when the template object is first created.
For those who aren't familiar with this, he is talking about the
Template Toolkit plugin for CGI::Application
(CGI::Application::Plugin::TT).
Cheers,
Cees
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates