summaryrefslogtreecommitdiffstats
path: root/system/libraries/Table.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-12 15:27:25 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-12 15:27:25 +0100
commit997c0da672a5483fd88fe96272004a13ad510cd4 (patch)
tree781578ae4af3ceee278ab9c0674110f3b8aff3ff /system/libraries/Table.php
parent95bd1d1a5f5bdccfde53cc27d7d5c20991112643 (diff)
parent21e7a3b315335a622b73710f0effa09dc0f85bb6 (diff)
Merge pull request #1078 from mikedfunk/feature/table_config
Ability to use a configuration file for the Table class
Diffstat (limited to 'system/libraries/Table.php')
-rw-r--r--system/libraries/Table.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/system/libraries/Table.php b/system/libraries/Table.php
index 8651b9e69..ceda6f323 100644
--- a/system/libraries/Table.php
+++ b/system/libraries/Table.php
@@ -49,9 +49,23 @@ class CI_Table {
public $empty_cells = '';
public $function = FALSE;
- public function __construct()
+ // --------------------------------------------------------------------------
+
+ /**
+ * Set the template from the table config file if it exists
+ *
+ * @param array $config (default: array())
+ * @return void
+ */
+ public function __construct($config = array())
{
log_message('debug', "Table Class Initialized");
+
+ // initialize config
+ foreach ($config as $key => $val)
+ {
+ $this->template[$key] = $val;
+ }
}
// --------------------------------------------------------------------