summaryrefslogtreecommitdiffstats
path: root/table.php
diff options
context:
space:
mode:
authorraylu <raylu@mixpanel.com>2011-07-02 17:02:07 -0700
committerraylu <raylu@mixpanel.com>2011-07-02 17:02:07 -0700
commit05a2b26d9038752a40348a3f226e44710833c49b (patch)
tree9bc3e49ac2e84b33ca5ff6e44eb7e5f2c02d13bf /table.php
parent83483a1826d1d05e2f9733746f35fef1939b8c0a (diff)
downloadotakuhub-05a2b26d9038752a40348a3f226e44710833c49b.tar.xz
pull in dev branch changes
not pulled: swiftmailer, gzip
Diffstat (limited to 'table.php')
-rw-r--r--table.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/table.php b/table.php
new file mode 100644
index 0000000..fd82c8b
--- /dev/null
+++ b/table.php
@@ -0,0 +1,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>"
+}
+?> \ No newline at end of file