[Templates] process lists of array_refs with Template-Toolkit?

mt 6am3@gmx.net
Mon, 20 Oct 2003 11:56:46 +0200


i want to know if it is in general possible to process lists of 
array_refs with Template-Toolkit.

i have a sub, returning
  return( $sth->fetchall_arrayref);

this should now be processed via Template-Toolkit.

but how can this be done?

i have a sub
my $t=Fs2::DBrequest::search_pl_entries(1,1,"a");


i tried

## first try
##########################################


   if ($c{a} eq "c_searchtest")
   {
     $vars = { search            => $f
     };
   }



##########################################
## second try

my @f = @$t;
   if ($c{a} eq "c_searchtest")
   {
     $vars = { search            => $t
     };
   }




## and in the template
[% FOREACH foo = f  %]

<pre>
START THE OUTPUT
[% foo.0 %]
[% foo.1 %]

</pre>
[% END %]
##


but none of the 2 are working.
and besides, Template-Toolkit does not output errors, so i don't know 
what's the story...

is it possible to process arrays of array, hashes of arrays, lists of 
array_refs with Template?

any suggestions or examples out there?

thanks
parasew

--
http://parasew.sonance.net
http://fs2.at
http://mmm.ok.ag