Anonymous function Validation |
01-30-2017, 11:40 AM
(This post was last modified: 01-30-2017, 11:47 AM by PaulD. Edit Reason: Added final note )
Hi,
I would put the model call into a callback, something like this: PHP Code: $this->form_validation->set_rules( 'email', 'Email Address', 'trim|required|valid_email|callback_permission_check'); And your callback function in your controller would look something like: PHP Code: private function permission_check() { In that way you can still set an error message. I read you link and have never used that method, so sorry if the above suggestion is a bit off topic. |
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
|