X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-test.git;a=blobdiff_plain;f=yarrg%2Fweb%2Fdumptable;h=4e1fb3e5215e743ec7be8f06b505ecd82f44a2a8;hp=20dc25f12ceb4ea7a77e51302e7ec9557b53e10a;hb=1f6f88af87868d6e059be154ed6b56dd9ea7ac6c;hpb=bdad24af2d97e3448b671da80bb4247411bafbea diff --git a/yarrg/web/dumptable b/yarrg/web/dumptable index 20dc25f..4e1fb3e 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 @@ -59,7 +59,7 @@ $cols => $sth->{NAME} $qa => undef % if (!$qa || $qa->{'debug'}) { - +
% foreach my $field (@$cols) {
<% $field |h %> @@ -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) {