From 326a5e75db1e03e453f488f2d612b0f421806129 Mon Sep 17 00:00:00 2001 From: Mike Funk Date: Fri, 24 Feb 2012 10:06:28 -0500 Subject: added config process method checking for delimiter values, updated changelog and user guide. --- system/libraries/Form_validation.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'system/libraries') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 0a6a2af0d..93ec8b34a 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -55,6 +55,9 @@ class CI_Form_validation { { $this->CI =& get_instance(); + // applies delimiters set in config file. + $this->_config_delimiters(); + // Validation rules can be stored in a config file. $this->_config_rules = $rules; @@ -69,6 +72,27 @@ class CI_Form_validation { log_message('debug', "Form Validation Class Initialized"); } + + // -------------------------------------------------------------------- + + /** + * if prefixes/suffixes set in config, assign and unset. + * + * @return void + */ + private function _config_delimiters() + { + 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']); + } + } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b