Welcome Guest, Not a member yet? Register   Sign In
Form Validation - Modify Second Parameter
#7

[eluser]Aken[/eluser]
Yes, makes sense. You're correct then, it's a variable scope issue. The $param variable is created fresh each time the callback is run, based on the info passed to it in the rule. If you call "callback_valid_address[10]", $param = 10. "callback_valid_address[15]", $param = 15. Etc...

You'll want to use a class property if you want to hold on to the value of a property throughout the class. psychoder gave a good example.


Messages In This Thread
Form Validation - Modify Second Parameter - by El Forum - 01-30-2012, 05:13 PM
Form Validation - Modify Second Parameter - by El Forum - 01-30-2012, 05:32 PM
Form Validation - Modify Second Parameter - by El Forum - 01-30-2012, 05:40 PM
Form Validation - Modify Second Parameter - by El Forum - 01-30-2012, 05:48 PM
Form Validation - Modify Second Parameter - by El Forum - 01-30-2012, 05:50 PM
Form Validation - Modify Second Parameter - by El Forum - 01-30-2012, 05:52 PM
Form Validation - Modify Second Parameter - by El Forum - 01-30-2012, 05:56 PM
Form Validation - Modify Second Parameter - by El Forum - 01-30-2012, 06:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB