Re: [Templates] PRE_PROCESS question

[prev] [thread] [next] [Date index for 2005/05/20]

From: Cees Hek
Subject: Re: [Templates] PRE_PROCESS question
Date: 15:01 on 20 May 2005
On 5/20/05, Bruce McKenzie <bruce@xxxxxxxxxxxxxxxx.xxx> wrote:
> sub cgiapp_init {
>      my $self =3D shift;
>      $self->tt_config( TEMPLATE_OPTIONS =3D> $Config_TT::config),
>      $self->tt_params(%$Config_TT::subroutines);
>      $self->tt_params(username =3D> $username);
>      $self->tt_params(PRE_PROCESS =3D> '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 =3D shift;
     my $ttconfig =3D $Config_TT::config;
     $ttconfig->{PRE_PROCESS} =3D 'macros.tt2';
     $self->tt_config( TEMPLATE_OPTIONS =3D> $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
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] PRE_PROCESS question
Bruce McKenzie 13:00 on 20 May 2005

Re: [Templates] PRE_PROCESS question
Mark Mills 13:20 on 20 May 2005

Re: [Templates] PRE_PROCESS question
Cees Hek 15:01 on 20 May 2005

Generated at 15:56 on 25 May 2005 by mariachi v0.52