tims-todo/application/libraries/MY_Form_validation.php

34 lines
547 B
PHP
Raw Normal View History

2016-12-29 13:56:30 -05:00
<?php
/**
* Add some convenience methods to form_validation library
*/
class MY_Form_validation extends CI_Form_validation {
/**
* Returns an array of errors for the current form
*
* @return array
*/
public function get_error_array()
{
return array_values($this->_error_array);
}
/**
* Clears out object data
*
* @return void
*/
public function reset()
{
foreach([
'_field_data',
'_error_array',
'_error_messages'
] as $var) {
$this->$var = array();
}
}
}
2014-08-08 15:41:59 -04:00
// End of libraries/MY_Form_validation.php