70 |
|
|
71 |
my $text = $tt->apply( |
my $text = $tt->apply( |
72 |
template => 'text.tt', |
template => 'text.tt', |
73 |
data => \@ds |
data => $ds |
74 |
); |
); |
75 |
|
|
76 |
It also has follwing template toolikit filter routies defined: |
It also has follwing template toolikit filter routies defined: |
90 |
|
|
91 |
=head3 tt_filter_type |
=head3 tt_filter_type |
92 |
|
|
93 |
filter to return values of specified from @ds |
filter to return values of specified from $ds |
94 |
|
|
95 |
=cut |
=cut |
96 |
|
|
109 |
|
|
110 |
my ($name,$join) = @_; |
my ($name,$join) = @_; |
111 |
|
|
112 |
die "no data array" unless ($data->{'data'} && ref($data->{'data'}) eq 'ARRAY'); |
die "no data hash" unless ($data->{'data'} && ref($data->{'data'}) eq 'HASH'); |
113 |
# Hm? Should we die here? |
# Hm? Should we die here? |
114 |
return unless ($name); |
return unless ($name); |
115 |
|
|
116 |
my $item = first { $_->{'name'} eq $name } @{ $data->{'data'} }; |
my $item = $data->{'data'}->{$name} || return; |
|
|
|
|
return unless($item); |
|
117 |
|
|
118 |
my $v = $item->{$type} || return; |
my $v = $item->{$type} || return; |
119 |
|
|
151 |
$tt->to_file( |
$tt->to_file( |
152 |
file => 'out.txt', |
file => 'out.txt', |
153 |
template => 'text.tt', |
template => 'text.tt', |
154 |
data => \@ds |
data => $ds |
155 |
); |
); |
156 |
|
|
157 |
=cut |
=cut |