|Hi. How do I call a method from another class for the ValidationServerFunction? The standard way in php to call a callback function is array( $class_object, 'class_method' ). But this doesn't work. Nor does "$class_object->class_method". Not sure what to do here. Any help would be greatly appreciated.|
|2012-04-20 08:21:37 - In reply to message 1 from Larry Pack|
|You may try calling a static function of that class.|
If that would not do, maybe you can create a plug-in class that implements that kind of validation you want. That can handle both server and browser side validation if you need that too. Take a look at the test_custom_validation.php example script.
|2012-04-20 08:27:45 - In reply to message 2 from Manuel Lemos|
|Thanks for the reply. How would I call the static function? Would it be like this:|
|2012-04-20 08:44:21 - In reply to message 3 from Larry Pack|
|Hi again. Calling a static method doesn't work. However, if you modify line 3396 of forms.php to read|
you can then call static functions.
|2012-04-21 21:00:56 - In reply to message 4 from Larry Pack|
|Yes, you are right. I made the class use call_user_func instead, so it works with classes static functions, object class functions, or even closures. It will be made available in the next release. Thank you for the suggestion.|
|2012-04-22 06:19:49 - In reply to message 5 from Manuel Lemos|
|Awesome. Looking forward to the next release!|