Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [svalera] Passing a hash or a hash ref to template

Quote Reply
Re: [svalera] Passing a hash or a hash ref to template In reply to
You could do:

GT::Template->parse ('file.html', { Name1 => $Object1->{Name}, Name2 => $Object2->{Name} ... });

and then use <%Name1%>, <%Name2%>. If the value of a tag is a hash, there is no way in the template to access it. You could use a global though:

sub {
my $tags = shift;
return "Name1: $tags->{Object1}->{Name}, Name2: $tags->{Object2}->{Name} ... ";
}

Cheers,

Alex
--
Gossamer Threads Inc.
Subject Author Views Date
Thread Passing a hash or a hash ref to template svalera 2735 Jan 25, 2002, 5:51 AM
Thread Re: [svalera] Passing a hash or a hash ref to template
Paul 2664 Jan 25, 2002, 5:55 AM
Thread Re: [RedRum] Passing a hash or a hash ref to template
svalera 2649 Jan 25, 2002, 6:08 AM
Thread Re: [svalera] Passing a hash or a hash ref to template
Alex 2646 Jan 25, 2002, 12:46 PM
Thread Re: [Alex] Passing a hash or a hash ref to template
svalera 2684 Jan 25, 2002, 1:39 PM
Thread Re: [svalera] Passing a hash or a hash ref to template
Alex 2664 Jan 25, 2002, 3:51 PM
Thread Re: [Alex] Passing a hash or a hash ref to template
svalera 2655 Jan 25, 2002, 4:16 PM
Post Re: [svalera] Passing a hash or a hash ref to template
Alex 2640 Jan 25, 2002, 4:54 PM