Welcome Guest, Not a member yet? Register   Sign In
set_value() and callbacks
#2

[eluser]Pascal Kriete[/eluser]
Callbacks can return one of two things:
- A boolean (TRUE / FALSE) to indicate a passed or failed rule.
- A string that will be used as the new value. Trim, for example, does this.

We check the type of the return value (is_bool()), so in your example you need to explicitly return FALSE if it fails.

Code:
return ($query->num_rows == 1) ? TRUE : FALSE;


Messages In This Thread
set_value() and callbacks - by El Forum - 09-11-2010, 11:49 PM
set_value() and callbacks - by El Forum - 09-12-2010, 10:42 AM
set_value() and callbacks - by El Forum - 09-13-2010, 09:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB