|
Apache::Wyrd::Lattice - Generate HTML Tables from Tabular Data |
Apache::Wyrd::Lattice - Generate HTML Tables from Tabular Data
<BASENAME::Lattice>
<BASENAME::Query>
<BASENAME::CGISetter style="sql">
select name, email from contact_database
where name=$:name
</BASENAME::CGISetter>
</BASENAME::Query>
<BASENAME::Lattice::Header>
<table class="ctable">
<tr><th>Name</th><th>E-Mail</th></tr>
</BASENAME::Lattice::Header>
<BASENAME::Lattice::Grid>
<tr bgcolor="#CCCCCC">
<td class="namecol">$:name</td>
<td class="emailcol"><a href="mailto:$:email">$:email</a></td>
</tr></BASENAME::Lattice::Grid>
<BASENAME::Lattice::Footer></table></BASENAME::Lattice::Footer>
</BASENAME::Lattice>
The Lattice Wyrd represents the result of an Apache::Wyrd::Query Wyrd in
HTML. Three supporting Wyrds, Apache::Wyrd::Lattice::Header,
Apache::Wyrd::Lattice::Grid, Apache::Wyrd::Lattice::Footer give the HTML a
beginning, a repeated middle, and an end.
Unless provided within the Lattice Wyrd, as in the SYNOPSIS, the Lattice
Wyrd defaults to a simple HTML table. The cols attribute is parsed
(whitespace/comma) to determine these columns. If no cols attribute is
given, the Grid Wyrd is scanned for placemarkers in the
Apache::Wyrd::Interfaces::Setter style. Lastly, if no Grid Wyrd is given,
Lattice will attempt to create a Grid based on the columns returned by the
Query. The data will appear in this grid, one column per table column.
(format: (returns) name (arguments after self))
_format_table (scalar)_format_tr (scalar)_format_th (scalar)_format_td (scalar)_format_xxx methods for tables,
rows, headers, and cells.
Reserves the _setup and _generate_output methods. Also reserves the register_header, register_grid, register_footer, and register_query methods for the respective sub-Wyrds. ``Automatic'' formatting is provided by the private methods _auto_encapsulate, _auto_header, _auto_grid, _aouto_footer, and _cols_from_grid.
Barry King <wyrd@nospam.wyrdwright.com>
Copyright 2002-2004 Wyrdwright, Inc. and licensed under the GNU GPL.
See LICENSE under the documentation for Apache::Wyrd.
|
Apache::Wyrd::Lattice - Generate HTML Tables from Tabular Data |