On 6/12/07, Matt S Trout <[EMAIL PROTECTED]> wrote:
On Tue, Jun 12, 2007 at 12:49:55AM -0400, Li Hao wrote:
> Hi, folks:
>
> I am very new to DBIx::Class, so please bear with my simple questions...
>
> I previously use DBIx::Simple to handle DBI and it contains methods to
> handle tables pretty easily(use DBIx::XHTML_Table). Now I am planning
> to migrate my code to use DBIx::Class. I've read the documentations
> several days and migrated most of my code from DBIx::Simple to
> DBIx::Class except printing out the tables.. Could someone recommend a
> similar module as DBIx::XHTML_Table to populate a table which work
> with DBIx::Class?? Thanks..
my $rows = $rs->cursor->all;
That can go to XHTML_Table style_3.
Hi, Matt: thanks..That's exactly what I am looking for.. I've packed
it into a method of a ResultSet class... something like:
sub html
{
my ($self, $attr, $title) = @_;
my $rows = [ $self->cursor->all ];
my $header = defined $title ? 0 : 1;
return DBIx::XHTML_Table->new($rows, $title, $attr)->output({
no_header => $header});
}
everything works very well so far... I need to provide a header from
outside the resultset though. :-)
Have a good day,
XC
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/