Welcome Guest, Not a member yet? Register   Sign In
Extending Form validation Constructor Error
#1

[eluser]OES[/eluser]
Hi Peeps.

Have any of you come accross this yet.

I can extend Form_validation no problem at all but as soon as I add a constructor it breaks. There are no errors but you do not get your error messages from the function.

IE
Code:
class MY_Form_validation extends CI_Form_validation {

  function MY_Form_validation()
  {
    parent::CI_Form_validation();
  }
}

Removal of the constructor it then works. ?

Any ideas.
#2

[eluser]Pascal Kriete[/eluser]
The config array associated with the class is automatically passed to the constructor. Since your rules are probably stored in the config file, you need to account for that array:
Code:
class MY_Form_validation extends CI_Form_validation {

    function MY_Form_validation($config = array())
    {
        parent::CI_Form_validation($config);
    }
}
#3

[eluser]OES[/eluser]
Hey thanks Inparo.

Perfect.




Theme © iAndrew 2016 - Forum software by © MyBB