From 676a0dd74409e7e838b94484ef9ba066dcf6db91 Mon Sep 17 00:00:00 2001 From: Michiel Vugteveen Date: Fri, 2 Mar 2012 10:10:34 +0100 Subject: updated error_array #565 --- system/libraries/Form_validation.php | 14 ++++++++++++++ user_guide_src/source/changelog.rst | 1 + user_guide_src/source/libraries/form_validation.rst | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 2ee734ae6..5069a44c1 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -234,6 +234,20 @@ class CI_Form_validation { // -------------------------------------------------------------------- + /** + * Get Array of Error Messages + * + * Returns the error messages as an array + * + * @return array + */ + public function error_array() + { + return $this->_error_array; + } + + // -------------------------------------------------------------------- + /** * Error String * diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index d652f1cbd..6505e7489 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -75,6 +75,7 @@ Release Date: Not Released - Minor speed optimizations and method & property visibility declarations in the Calendar Library. - Removed SHA1 function in the :doc:`Encryption Library `. - Added $config['csrf_regeneration'] to the CSRF protection in the :doc:`Security library `, which makes token regeneration optional. + - Added function error_array() to return all error messages as an array in the Form_validation class. - Core diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index e7875bc22..09a192bb0 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -930,6 +930,15 @@ $this->form_validation->set_message(); Permits you to set custom error messages. See :ref:`setting-error-messages` +$this->form_validation->error_array(); +======================================== + + .. php:method:: error_array () + + :rtype: Array + + Returns the error messages as an array. + .. _helper-functions: **************** -- cgit v1.2.3-24-g4f1b