[Catalyst] beginner question: MVC / HTML, recommended practice

Sarah Berry berry.sarah at gmail.com
Thu Aug 3 23:04:36 CEST 2006


I'm getting ready to create a database-driven HTML table, and I'm
trying to plan what logic goes where. I'm using TTSite to display my
pages.

I've already had the opportunity to learn how to pull data from a
database on another Catalyst page. What I'm stuck on is how best to
generate the HTML table once I've got the data.  The structure of the
table itself, and not just its contents, will depend heavily on the
data.

I've searched the mailing list archives and reviewed the basic
concepts of MVC programming. So far I think the HTML table should not
be generated by the template, but rather by a separate Perl module
that the template could then access. Is that correct? Would I generate
the table in View/whatever.pm, concatenate the HTML into one long
string, and put it in the stash? Or would I put the Perl script that
generates the table into a .pl file and make it an include in the
template? What's the Catalyst "best practice"?

Thanks,
Sarah Berry



More information about the Catalyst mailing list