[Catalyst] generic db table list

Fernan Aguero fernan at iib.unsam.edu.ar
Fri Jun 2 14:40:59 CEST 2006


+----[ Aran Deltac <aran at arandeltac.com> (01.Jun.2006 23:54):
|
| On 6/1/06, Aran Deltac <aran at arandeltac.com> wrote:
| >On 6/1/06, Fernan Aguero <fernan at iib.unsam.edu.ar> wrote:
| [snip]
| >> and it works, but this is just because I'm using the column
| >> names for this particular case ... or saying it another way,
| >> I've not found a way for looping through all the keys of a
| >> hash in TT, like you can do with raw perl:
| >> foreach $key ( keys(%hash) )
| >
| >Go to the docs for template toolkit and search for the string "The
| >FOREACH directive can also be used to iterate through the entries in a
| >hash array.".
| 
| On second thought, this is more likely what you are looking for is this:
| 
| [% FOREACH key IN hash.keys %]
|       * [% key %]
| [% END %]

This is not working for me ... maybe I'm wrongly guessing
that rs.next() returns a hash?

The following doesn't print anything:

[% FOREACH row in rs.next() %]
[% FOREACH column in row.keys %]
	[% column %] [% row.$column %]
[% END %]
[% END %]


| This is documented in the TT VMethods Manual.
|
| Aran
|
+----]

Thanks, I see it now.

Fernan



More information about the Catalyst mailing list