Welcome Guest, Not a member yet? Register   Sign In
Form Validation > Extend CI Base

When I tried to extend the Form Validation CI base class I faced a problem that I would like to share with you. Perhaps this could be useful to someone, I lost a few hours trying to solve it.

Extending Form_validation CI base class in the usual way won’t work with the rules in a config file.So we need to do this:

function MO_Form_validation($rules = array())

I've discussed this topic in another post


I've also spent several hours trying to extend the CI_Form_validation class without any luck!! I don't want to crash your thread, so I'll post my details in a new one

Just glanced at your code, but it seems as if you are calling the wrong parent constructor. If you are trying to extend the class 'CI_Form_validation' it would be...

class MO_Form_validation extends CI_Form_validation {

  function MO_Form_validation( $rules = array() ) {

    parent::CI_Form_validation( $rules );



Sorry, I did it like you said but I wrote the code wrong here Wink Thanks anyway, I'm going to update it.

Theme © iAndrew 2016 - Forum software by © MyBB