summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/libraries/Form_validation.php12
-rw-r--r--user_guide_src/source/libraries/form_validation.rst2
2 files changed, 7 insertions, 7 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 2bebd2f9a..c410e4228 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -178,7 +178,7 @@ class CI_Form_validation {
$label = isset($row['label']) ? $row['label'] : $row['field'];
// Add the custom error message array
- $errors = (isset($row['error_msg']) && is_array($row['error_msg'])) ? $row['error_msg'] : array();
+ $errors = (isset($row['errors']) && is_array($row['errors'])) ? $row['errors'] : array();
// Here we go!
$this->set_rules($row['field'], $label, $row['rules'], $errors);
@@ -229,7 +229,7 @@ class CI_Form_validation {
'field' => $field,
'label' => $label,
'rules' => $rules,
- 'error_msg' => $errors,
+ 'errors' => $errors,
'is_array' => $is_array,
'keys' => $indexes,
'postdata' => NULL,
@@ -609,9 +609,9 @@ class CI_Form_validation {
$type = in_array('required', $rules) ? 'required' : 'isset';
// Check if a custom message is defined
- if (isset($this->_field_data[$row['field']]['error_msg'][$type]))
+ if (isset($this->_field_data[$row['field']]['errors'][$type]))
{
- $line = $this->_field_data[$row['field']]['error_msg'][$type];
+ $line = $this->_field_data[$row['field']]['errors'][$type];
}
elseif (isset($this->_error_messages[$type]))
{
@@ -758,9 +758,9 @@ class CI_Form_validation {
if ($result === FALSE)
{
// Check if a custom message defined
- if(isset($this->_field_data[$row['field']]['error_msg'][$rule]))
+ if(isset($this->_field_data[$row['field']]['errors'][$rule]))
{
- $line = $this->_field_data[$row['field']]['error_msg'][$rule];
+ $line = $this->_field_data[$row['field']]['errors'][$rule];
}
elseif ( ! isset($this->_error_messages[$rule]))
{
diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst
index 00f7c4125..3efdc862b 100644
--- a/user_guide_src/source/libraries/form_validation.rst
+++ b/user_guide_src/source/libraries/form_validation.rst
@@ -267,7 +267,7 @@ you use this approach, you must name your array keys as indicated::
'field' => 'password',
'label' => 'Password',
'rules' => 'required',
- 'error_msg' => array(
+ 'errors' => array(
'required' => 'You must provide a %s.',
),
),