Welcome Guest, Not a member yet? Register   Sign In
Form validation not added to ci classes
#1

[eluser]JanDoToDo[/eluser]
hey guys,

So i have a problem in that none of my errors are being displayed. I tried echoing all validation errors but still nothing comes up. this is my code.

Code:
$this -> load -> library('form_validation');
        
$this -> form_validation -> set_rules('contact_name',    lang("name"),     'trim|required');
$this -> form_validation -> set_rules('contact_email',lang("email"), 'trim|required|valid_email');
        

if ($this -> form_validation -> run() === FALSE) :
    var_dump(validation_errors());
else :
blah blah blah
end if;
and basically nothing shows up. I tried doing this var_dump(_get_validation_object()) but that returns FALSE. So, i went through that function and found that actually, the line 1007 in the form validation library
Code:
if ( ! isset($CI->load->_ci_classes) OR  ! isset($CI->load->_ci_classes['form_validation']))
        {
        var_dump('test4'); exit;
            return $return;
        }
my dump there is being called. I separated these out and found that its the ! isset($CI->load->_ci_classes['form_validation']) which is causing the problem. So it always returns false. Anyone know whats happening here?
#2

[eluser]WanWizard[/eluser]
Using some kind of modular solution?
#3

[eluser]InsiteFX[/eluser]
Maybe from all the spaces around ->

InsiteFX
#4

[eluser]JanDoToDo[/eluser]
Hey guys. Thanks I solved the issue. Its because the core CI files were from a previous version and the way they initiated classes was different. Updated the files and sorted itself out. Cheers!




Theme © iAndrew 2016 - Forum software by © MyBB