X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=blobdiff_plain;f=yarrg%2Fweb%2Fdumptable;h=739f14d8b04f8eb3a8993f3572637c9f804ce22d;hp=20dc25f12ceb4ea7a77e51302e7ec9557b53e10a;hb=a47db0ee7177ab09fea575b793520550f6bcd388;hpb=bdad24af2d97e3448b671da80bb4247411bafbea diff --git a/yarrg/web/dumptable b/yarrg/web/dumptable index 20dc25f..739f14d 100644 --- a/yarrg/web/dumptable +++ b/yarrg/web/dumptable @@ -31,7 +31,7 @@ This Mason component is helpful for debugging and developing. It outputs plain HTML tables eg for SQL query results. You can either: - <& dumptable, sth = $executed_statement_handle &> + <& dumptable, sth => $executed_statement_handle &> in which case it will consume the results of the statement and print them unconditionally, or do the equivalent of: <& dumptable:start, sth => $sth, [ qa => $qa ] &> or @@ -96,6 +96,19 @@ $qa => undef % } +<%method literal> +<%args> +$cols +$rows +$qa => undef + +<& SELF:start, cols => $cols &> +% foreach my $row (@$rows) { +<& SELF:row, cols => $cols, row => $row &> +% } +<& SELF:end &> + + <& SELF:start, sth => $sth &> % my $row; % while ($row= $sth->fetchrow_hashref) {