Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Usign a hashref in a template

Quote Reply
Usign a hashref in a template
Hi all

Got a small issue. I have a sub that returns a hashref to be used by a template to do lookups (validate states) without using too much DB ressources. My problem is that I don't know how to access this hash in the template tags (<%... %>).

I've tried the usual syntax : <% myhashref->{myitem} %> but this always returns 0, even for valid items.
Using the dump function of GT::Forum, I can see my Hash with all its values.

I've also tries writing a new perl sub that would accept this hash as arguement. On the other side, my hashref got transformed into a plain string holding the name of the variable holding the hashref...?

So, is there a way to use a hashref in a template outside of a loop?

If anybody knows...

Thank you!

Eric.
Subject Author Views Date
Thread Usign a hashref in a template rikgig 2073 May 20, 2008, 6:46 PM
Thread Re: [rikgig] Usign a hashref in a template
brewt 1992 May 20, 2008, 9:40 PM
Post Re: [brewt] Usign a hashref in a template
rikgig 1992 May 21, 2008, 5:52 AM