[Templates] sending perl hash to template

allan lambretta@inet.uni2.dk
Sun, 29 Sep 2002 22:44:45 +0200


thank you,

worked perfectly!
wasn't aware of the VM

thanks again
./allan


> You can access the contents of the hash from within the template toolkit
> with the keys and values virtual methods like so:
> 
>     [% FOREACH key = product.keys %]
>      [% key %] is [% product.$key %]
>     [% END %]
> 
> This is documented in the vmethods page[2]
> 
> Mark.
> 
> [1] http://www.perldoc.com/perl5.8.0/pod/perlreftut.html
>     http://www.perldoc.com/perl5.8.0/pod/perlref.html
> 
> [2] http://www.tt2.org/docs/leon/Manual/VMethods.html#Hash_Virtual_Methods
> 
> --
> s''  Mark Fowler                                     London.pm   Bath.pm
>      http://www.twoshortplanks.com/              mark@twoshortplanks.com
> ';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
> ){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}
> 
> _______________________________________________
> templates mailing list
> templates@template-toolkit.org
> http://www.template-toolkit.org/mailman/listinfo/templates