Hi Will,
You want:
$c->stash->{recs} = [EMAIL PROTECTED];
And then to access it in the Template Toolkit template, you want:
[% FOREACH row IN recs %]
id: [% row.id %]
name: [% row.name %]<br />
[% END %]
And you should probably check out the following two URLs for more info
on Catalyst + Template Toolkit.
http://search.cpan.org/dist/Catalyst-Manual/
http://www.template-toolkit.org/docs/plain/Manual/index.html
- Jim
Will Smith wrote:
I have the following piece of code:
# in controller
...
while ( my $row = $file->read ) {
push @record, {
id => $row->{id},
name => $row->{name},
};
}
$c->stash->{recs} = @records;
.....
What is the syntax on the tt2 to access the id and name?
Or please point me to somewhere that I could do some reading on the question.
Thank you
--
Jim Spath
Lead Developer
Pangea Media
Em: [EMAIL PROTECTED]
Ph: 617.314.6687
Fx: 617.390.7824
IM: panJimS (AIM)
_______________________________________________
List: [EMAIL PROTECTED]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/