I am developing an application using codeigniter HMVC architecture. I am pretty new to HMVC and have just started to explore it. Recently I began to transform my code into HMVC from MVC in codeigniter. I have developed a custom authentication library which resides in my application/libraries folder which has authentication rules for registration and login form. I have written some callback functions in my validations which suddenly stopped working when I opted for HMVC framework. I came across some references to fix this but all in vain. I couldn't somehow make my code working. According to a common suggestion I have built up a MY_Form_validation as below:
class MY_Form_validation extends CI_Form_validation
{
public $CI;
}
And then in my authentication library I am using this:
$this->CI = & get_instance();
$this->CI->load->library('form_validation');
$this->CI->form_validation->CI = $this->CI;
and for validation I use this:
if($this->CI->form_validation->run($this->CI)==FALSE)
But somehow my validation check is not being performed. It used to work on my MVC framework.