CodeIgniter Validation in Library does not accept callback.

Posted by Lukas Oppermann on Stack Overflow See other posts from Stack Overflow or by Lukas Oppermann
Published on 2010-06-12T18:36:26Z Indexed on 2010/06/12 18:42 UTC
Read the original article Hit count: 232

Filed under:
|
|
|
|

Hey guys,

my problem is the following: I am writing a login library. This library has a function _validation() and this uses the validation library to validate the data. With using normal validation methods it works just fine, but using a callback function just does not work. It is not called.

I call it like this.

$this->CI->form_validation->set_rules('user', 'Username', 'required|callback__check_user');

The functions name is _check_user and it uses the username _check_user($user). The function itself works fine and I can also call it in the class ($this->_check_user('username')) with a working result.

I am guessing, there might be a problem because I am not workin in a controller so I have a CI instance $this->CI instead of just the original instance $this->

Does anyone have a clue how to fix this?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about php

Related posts about validation