diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-12 15:31:53 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-12 15:31:53 +0100 |
commit | e044d6c586728a28b291880dd37562f4a7551d36 (patch) | |
tree | cd309d72b20f6dbe11ae0d5ce0c7cf2168812ee7 /system/libraries | |
parent | 4c4740ec492b30aeb47cb1829525247053e4adfe (diff) | |
parent | 802953234f0b7669333807aaa3f2318778cde187 (diff) |
Merge upstream branch
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Form_validation.php | 12 | ||||
-rw-r--r-- | system/libraries/Table.php | 18 |
2 files changed, 26 insertions, 4 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 4ad31ebfa..826d94fb0 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -53,6 +53,18 @@ class CI_Form_validation { { $this->CI =& get_instance(); + // applies delimiters set in config file. + if (isset($rules['error_prefix'])) + { + $this->_error_prefix = $rules['error_prefix']; + unset($rules['error_prefix']); + } + if (isset($rules['error_suffix'])) + { + $this->_error_suffix = $rules['error_suffix']; + unset($rules['error_suffix']); + } + // Validation rules can be stored in a config file. $this->_config_rules = $rules; diff --git a/system/libraries/Table.php b/system/libraries/Table.php index 8651b9e69..99d001ce5 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -25,8 +25,6 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * HTML Table Generating Class * @@ -49,9 +47,21 @@ 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"); + log_message('debug', 'Table Class Initialized'); + + // initialize config + foreach ($config as $key => $val) + { + $this->template[$key] = $val; + } } // -------------------------------------------------------------------- |