blob: fd82c8b69357715ac1af0f0e7134aad1497ff9b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<?php
//table helper
public function table($data, array $headers = array(), array $options = array()) {
//Create the table
echo '<table>\n';
echo '<tr>';
foreach ($headers as $k => $v)
{
echo "<th>$v</th>"
}
echo "</tr>\n"
foreach ($data as $item)
{
echo '<tr>'
foreach($header as $key => $value)
{
echo "<td>$data->$key</td>\n"
}
echo "</tr>\n"
}
echo "</table>"
}
?>
|