CodeIgniter: HMVC custom form validation solution

HMVC (wiredesignz) withCodeIgnitor has an issue with form validation.

 

Usage:
Include $this as a parameter in the $this->form_validation->run() function call:

if ($this->form_validation->run($this)) {
    //your code... 
}
Function:
To resolve this problem, create MY_Form_validation.php file inside the application/libraries folder:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class MY_Form_validation extends CI_Form_validation
{
    function run($module = '', $group = '') {
        (is_object($module)) AND $this->CI =& $module;
        return parent::run($group);
    }
}
/* End of file MY_Form_validation.php */
/* Location: ./application/libraries/MY_Form_validation.php */

Leave a Reply