in reply to Re^2: CGI::Ajax + Template::Toolkit Question
in thread CGI::Ajax + Template::Toolkit Question
Rather than passing the configuration variables in $config to process, as chargrill noted, you can specify these when creating the $tt object:
and then specify the variables you want processed in your template in process:my $config = { INCLUDE_PATH => '/tt', INTERPOLATE => 1, POST_CHOMP => 1, PRE_PROCESS => 'header', EVAL_PERL => 1, }; my $tt = Template->new($config);
sub main_page { my $output = ''; my $template = 'main.tt'; my $vars = { title =>'AJAX Login'}; $tt->process($template, $vars, \$output) || die $tt->error(); return $output; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: CGI::Ajax + Template::Toolkit Question
by stonecolddevin (Parson) on Mar 09, 2007 at 01:01 UTC | |
by randyk (Parson) on Mar 09, 2007 at 07:12 UTC |
In Section
Seekers of Perl Wisdom