Welcome Guest, Not a member yet? Register   Sign In
Anonymous function Validation
#3

@PaulD

It is a callback and does work and run the function but the set_message just is not working. The issue with doing it the way you suggest is that you now have processing stuff in your controller, which you should not do because anyone can hit the public page to run the function. Also, when I make the function private, it tells me I can't do that. I also want to use the validation in more than one class as well.

Regarding passing a value through, you actually can do that with your suggestion by doing this:


PHP Code:
$this->form_validation->set_rules( 'email', 'Email Address', 'trim|required|valid_email|callback_permission_check[passed_value]'); 

The suggestion is not really off topic, but just doesn't help in what I am wanting it to do.
Reply


Messages In This Thread
Anonymous function Validation - by burgoyn1 - 01-29-2017, 10:00 PM
RE: Anonymous function Validation - by PaulD - 01-30-2017, 11:40 AM
RE: Anonymous function Validation - by burgoyn1 - 01-30-2017, 01:45 PM
RE: Anonymous function Validation - by PaulD - 01-30-2017, 02:01 PM
RE: Anonymous function Validation - by burgoyn1 - 01-31-2017, 04:37 AM
RE: Anonymous function Validation - by shernandez - 06-12-2017, 06:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB