16 |
|
|
17 |
=head1 VERSION |
=head1 VERSION |
18 |
|
|
19 |
Version 0.06 |
Version 0.07 |
20 |
|
|
21 |
=cut |
=cut |
22 |
|
|
23 |
our $VERSION = '0.06'; |
our $VERSION = '0.07'; |
24 |
|
|
25 |
=head1 SYNOPSIS |
=head1 SYNOPSIS |
26 |
|
|
45 |
|
|
46 |
sub new { |
sub new { |
47 |
my $class = shift; |
my $class = shift; |
48 |
my $self = {@_}; |
my $self = {@_}; |
49 |
bless($self, $class); |
bless($self, $class); |
50 |
|
|
51 |
my $log = $self->_get_logger; |
my $log = $self->_get_logger; |
52 |
|
|
53 |
# create Template toolkit instance |
# create Template toolkit instance |
54 |
$self->{'tt'} = Template->new( |
$self->{'tt'} = Template->new( |
55 |
INCLUDE_PATH => $self->{'include_path'}, |
INCLUDE_PATH => $self->{'include_path'}, |
56 |
FILTERS => $self->{'filter'}, |
#FILTERS => $self->{'filters'}, |
57 |
EVAL_PERL => 1, |
EVAL_PERL => 1, |
58 |
); |
); |
59 |
|
|
60 |
$log->logdie("can't create TT object: $Template::ERROR") unless ($self->{'tt'}); |
$log->logdie("can't create TT object: $Template::ERROR") unless ($self->{'tt'}); |
61 |
|
|
62 |
$log->debug("filters defined: ",Dumper($self->{'filter'})); |
$log->debug("filters defined: ",Dumper($self->{'filters'})); |
63 |
|
|
64 |
$self ? return $self : return undef; |
$self ? return $self : return undef; |
65 |
} |
} |
268 |
return "load_template($template); return false;"; |
return "load_template($template); return false;"; |
269 |
}; |
}; |
270 |
|
|
271 |
|
if ($self->{filters}) { |
272 |
|
$args->{f} = $self->{filters}; |
273 |
|
$log->debug("using f.filters"); |
274 |
|
} |
275 |
|
|
276 |
my $out; |
my $out; |
277 |
|
|
278 |
$self->{'tt'}->process( |
$self->{'tt'}->process( |