[eluser]NoticeableDesigns[/eluser]
I have been working with Ci for quite some time and have always been able to work my way through a problem using the excellent CI docs and the forums with success so I hesitate at posting this question. I have spent the afternoon working with the newest download of HMVC available (5.3.3) and latest ci install. I am having trouble with the form validation class, as many seem to have had in the past. Initially I was loading the library at the start of the controller function and getting:
Code:
Severity: Notice
Message: Undefined property: CI::$form_validation
Filename: MX/Loader.php
Line Number: 141
After some research I found a number of posts making reference to extending the form validation class, which I have added to application/libraries/MY_Form_validation.php
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class MY_Form_validation extends CI_Form_validation
{
function run($module = NULL, $group = '') {
if (is_object($module)) $this->CI =& $module;
return parent::run($group);
}
}
/* End of file MY_Form_validation.php */
/* Location: application/libraries/MY_Form_validation.php */
This did not seem to correct my error so with some more research I found some references to loading the library prior to the controller using autoload.
I removed the call to load the library in the controller and added it to my autoload.php file:
Code:
$autoload['libraries'] = array('Form_validation');
This did not help rid the error either.
If I remove the MY_Controller file and operate as simply a Modular Seperation setup, the error disappears and the library functions except that it will not display the form errors when returning to the form. I would really like to retain all the functionality of this great resource as the application I am building is starting to become slightly overwhelming without the use of some type of modular seperation.
What am I missing, or is this possibly an issue with the latest release?
Forgive me for posting what is probably a simple question to seasoned CI veterans, but I will admit I am lost on this one.