add library of MY_Form_validation and add function that you want to add in form validation library
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Form_validation extends CI_Form_validation {
function __construct(){ parent::__construct(); }
function error_array(){ return $this->_error_array; }
}
and call function in your controller
if($this->form_validation->run()){
}else{
$this->form_validation->error_array();
}
error_array will return all the required parameter that you will getfrom
form_error('field_name')
Comments
Post a Comment