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
Hi,

You can't access hash's in the template. The only time you can is when you have an array of hashes, in that case you can use loops. Each time through the loop, the hash is available.

So you can do:

GT::Template->parse('file.html', { hash_loop => [ $hash1, $hash2, $hash3 ] });

<%loop hash_loop%>
Name: <%Name%>
<%endloop%>

Hope that helps,

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 2647 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