[eluser]Sven Delle[/eluser]
I've created MY_Form_validation.php in application/libraries, and put this into the file:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class MY_Form_validation extends CI_Form_validation
{
function __construct($config = array())
{
parent::__construct($config);
}
function error_array()
{
if (count($this->_error_array) === 0)
{
return FALSE;
}
else
{
return $this->_error_array;
}
}
}
/* End of file: ./application/libraries/MY_Form_validation.php */
I then load the library (have tried both automatically and manually) in a Controller. But I keep getting:
Quote:Message: Undefined property: MY_Form_validation::$error_array
I simply want the validation_errors as an array as I'd like to handle stuff differently. How can I achieve this in the simplest possible way (I find extending a bit overkill to get something as simple as an array - why is it protected in the first place)?