Re: [htmltmpl] loop through a hash structure without knowing the hash keys?
Brought to you by:
samtregar
From: Mathew R. <mat...@ne...> - 2005-12-01 21:59:16
|
It sounds like you need a tool which simply dumps the template variable=20 names (ie: using the $ht->params() function), rather than some special=20 mode to H::T Mathew Boon Chew wrote: > Ya sorry, that's what I meant. > > Right now I am working on some site code, and the designer sometimes=20 > have to come to me for stuff because he doesn't always know what hash=20 > keys I am passing to him (say sometimes I might add a new one,=20 > sometimes he mistype one, etc.). The whole point of doing this=20 > template separation is to decouple things, but if the designer can=20 > only figure out what's being passed into the template by looking at=20 > the module code, it kinda defeats the whole purpose. > > It would be such great convenience to be able to dump the whole thing=20 > on the HTML with a call like this: > > <tmpl_var story_loop> > > or > > <tmpl_loop story_loop> > <column_var> <-- outputs all keys here > </tmpl_loop> > > */Carl Franks <fir...@gm...>/* wrote: > > > e.g. > > > > > > > > a TMPL_LOOP doesn't take a hash, it takes an array-ref of hash-refs= > that would be > > my @loop =3D ( > {name =3D> 'a'}, > {name =3D> 'b'}, > ); > > $tmpl->param( students =3D> \@loop ); > > If you knew that already, give an example of what sort of data you > want to put in, and what you want the HTML to look like. > > Cheers, > Carl > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through > log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUN= K! > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dclick > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users > > > -----------------------------------------------------------------------= - > *Yahoo! Personals* > Single? There's someone we'd like you to meet. > Lots of someones, actually. Yahoo! Personals=20 > <http://us.rd.yahoo.com/evt=3D36108/*http://personals.yahoo.com%20>=20 |