Welcome Guest, Not a member yet? Register   Sign In
Form Validation "ignores" false results of custom functions placed in helper
#3

[eluser]Xelgen[/eluser]
I've mentioned this problem in the beginning of my post. callback_ prefix works only if function is placed inside the controller, but if it's function from helper, or just native php function with callback_ prefix it will not be even called.

If you look through code of /system/libraries/Form_validation.php you can see that.

If you place "callback_" prefix in rule, $rule is being checked and executed only if it's in $this->CI object space.
Code:
// Starting from Line 590:
if ($callback === TRUE)
            {
                if ( ! method_exists($this->CI, $rule))
                {        
                    continue;
                }
                
                // Run the function and grab the result
                $result = $this->CI->$rule($postdata, $param);


So, it's not the reason.


Messages In This Thread
Form Validation "ignores" false results of custom functions placed in helper - by El Forum - 01-16-2009, 08:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB