Welcome Guest, Not a member yet? Register   Sign In
From Validation Bug or Syntax
#1

I'm trying to call a custom validation method (), which reside in a custom library (). But I'm getting a CI error in libraries/Form_validation.php.
Not sure if this is a bug of a problem with my syntax. Code snipits below.

CONTROLLER
Code:
$this->form_validation->set_rules('name', 'Name', array($this->custom_validation_lib, '_alpha_custom'));

LIB
Code:
public function _alpha_custom($str){
    if(preg_match('/^[a-z\s\-\,\.\']*$/i', $str))
        return TRUE;
    else
        return FALSE;
}      


OUTPUT
A PHP Error was encountered

Severity: Warning

Message: preg_match() expects parameter 2 to be string, object given

Filename: libraries/Form_validation.php

Line Number: 693
Reply




Theme © iAndrew 2016 - Forum software by © MyBB