Welcome Guest, Not a member yet? Register   Sign In
Private callback functions
#5

[eluser]fireproofsocks[/eluser]
I was wondering the same thing. Adding "protected" or "private" to any of your controller's functions generates an error. My main concern was that by adding my own callback functions to my controller, I would be adding more URI, which I didn't want. You can use the underscore trick: any function whose name begins with an underscore is not considered a valid URI, so your validation rule might look like this:

Code:
// notice the two underscores following 'callback'
$this->form_validation->set_rules('something', 'Something', 'callback__custom_validate');

// [...]

function _custom_validate($str)
{
// ...
}


Messages In This Thread
Private callback functions - by El Forum - 08-30-2009, 11:54 AM
Private callback functions - by El Forum - 08-30-2009, 01:01 PM
Private callback functions - by El Forum - 08-30-2009, 01:06 PM
Private callback functions - by El Forum - 08-30-2009, 02:04 PM
Private callback functions - by El Forum - 10-22-2009, 12:45 PM
Private callback functions - by El Forum - 10-22-2009, 03:06 PM
Private callback functions - by El Forum - 10-22-2009, 03:44 PM
Private callback functions - by El Forum - 12-28-2009, 06:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB