Try something like:
[% FOREACH p = pages %]
<a href="[% l.${loop.index} %]">[% p %]</a>
[% END %]
loop.index is the current index in the array.
This should let you reference both at the same time.
On Mon, Apr 10, 2006 at 10:48:11AM -0700, Diego A. Gomez wrote:
> Hi!
> I`m new in the list.
> Sorry by my english, I`m from Argentina. I don`t find any list about T2T
> in spanish.
>
> I have 2 arrays, like these:
>
> 'pages' => ['Hotmail', 'Yahoo!','Ubbi','Argentina'],
> 'links' =>
> ['http://www.hotmail.com','http://mail.yahoo.com','http://mail.ubbi.com,'http://argentina.com']
>
> I need use the data of 2 arrays at same time, some like this:
>
> [% FOREACH p = pages, l = links %]
> <a href="[% l %]">[% p %]</a>
> [% END %]
>
> I see this don`t work. I only can "manupulate" 1 array by time (example [%
> FOREACH p = pages %], this work), but I need use information from 2 arrays
> at same time.
> The 2 arrays alwas has the same length.
>
> Some one can help me about how do this?
>
> Thanks!
>
> --
> Diego.-
>
> "Me sería muy difícil relatar cómo se han transformado mis convicciones,
> más aún, no siendo ello, probablemente, muy interesante"
>
> Fiodor Mijáilovich Dostoievski
> - El diario de un escritor -
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> _______________________________________________
> templates mailing list
> templates-MnLy+PD7ppGDO3lXZvfOKmD2FQJk+8+b@xxxxxxxxxxxxxxxx
> http://lists.template-toolkit.org/mailman/listinfo/templates
--
Todd Freeman Ext 6103 .^. Don't fear the penguins!
Programming Department /V\
Andrews University // \\ http://www.linux.org/
http://www.andrews.edu/~freeman/ /( )\ http://www.debian.org/
^^ ^^
signature.asc
Description: Digital signature
|