logo       

Re: Arrays: msg#00033

Subject: Re: Arrays
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/
                                        ^^ ^^

Attachment: signature.asc
Description: Digital signature

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe