Re: [Templates] Assigning to a list

[prev] [thread] [next] [Date index for 2005/04/28]

From: Josh Rosenbaum
Subject: Re: [Templates] Assigning to a list
Date: 17:31 on 28 Apr 2005
Maybe this will do what you want:

http://www.template-toolkit.org/docs/plain/Manual/Directives.html#Loop_Processing

    [% users = {
	 tom   => 'Thomas',
	 dick  => 'Richard',
         larry => 'Lawrence',
       }
    %]

    [% FOREACH u IN users %]
       * [% u.key %] : [% u.value %]
    [% END %]

-- Josh

Bart Simpson wrote:
> Can you assign to a list in a template? I tried
> everyway i can imagine. I want to get the key and
> value from the each function.
> 
> I tried :
> 
> [k v ] = hashref.each;
> (k v)  = hashref.each;
> (k , v)= hashref.each;
> k, v = hashref.each;
> 
> thanks
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> _______________________________________________
> templates mailing list
> templates@xxxxxxxxxxxxxxxx.xxx
> http://lists.template-toolkit.org/mailman/listinfo/templates


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] Assigning to a list
Bart Simpson 17:12 on 28 Apr 2005

Re: [Templates] Assigning to a list
Josh Rosenbaum 17:31 on 28 Apr 2005

Re: [Templates] Assigning to a list
Bart Simpson 17:42 on 28 Apr 2005

Generated at 10:28 on 04 May 2005 by mariachi v0.52