[Templates] process lists of array_refs with Template-Toolkit?
Jeff Anderson
captvanhalen@yahoo.com
Mon, 20 Oct 2003 06:45:31 -0700 (PDT)
You also asked this question at
<http://www.perlmonks.org/index.pl?node_id=300525>
Please list the other forums you have submitted
your question when you ask a question. It's just
good Netiquette.
jeffa
--- mt <6am3@gmx.net> wrote:
> 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
>
>
> _______________________________________________
> templates mailing list
> templates@template-toolkit.org
>
http://lists.template-toolkit.org/mailman/listinfo/templates
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com