Home » HTML » HTML_QuickForm » Bug #8582
Allow callback to use a static class method
Details
| Request #8582 | Allow callback to use a static class method |
|---|---|
| Submitted | 2006-08-29 21:57 UTC |
| From | benjaminhill at gmail dot com |
| Status | Bogus |
| Package | HTML_QuickForm |
| PHP Version | 5.1.4 |
| OS | WinXP |
| Roadmaps | (Not assigned) |
Comments
[2006-08-29 21:57 UTC] benjaminhill at gmail dot com
Description:
------------
I'm trying to build a completely OOP version of a user manager class. I've got a form-builder inside the class, that has:
$form->registerRule('checkemail', 'callback', 'is_new_email');
What I would very much prefer is
$form->registerRule('checkemail', 'callback', 'UserManager::is_new_email');
But that throws an error of unable to find the function - which seems like it should be able to handle?
[2006-08-31 13:55 UTC] mansion at php dot net
You can already do this if you use the fourth parameter of registerRule().
[2006-08-31 17:14 UTC] benjaminhill at gmail dot com
The tutorials I was learning from never mentioned that, it worked great, thanks!