Welcome Guest, Not a member yet? Register   Sign In
Extending Form_validation class fails
#1

[eluser]prezet[/eluser]
Hi,

I am extending the form validation library by the following:

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Form_validation extends CI_Form_validation {

function __construct()
{
  parent::__construct();
}
}

However, now, after running a validation check, the classes error array is empty... so anything like:

Code:
$this->form_validation->error_string(); // returns ""

If I remove MY_Form_validation, it comes back. What am I doing wrong?

My file lives here:

/application/libraries/MY_Form_validation.php

Thanks.
#2

[eluser]prezet[/eluser]
Fixed

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Form_validation extends CI_Form_validation {

function __construct($rules = array())
{
  parent::__construct($rules);
}
}




Theme © iAndrew 2016 - Forum software by © MyBB