PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #8582

Allow callback to use a static class method

Details

Request #8582Allow callback to use a static class method
Submitted2006-08-29 21:57 UTC
Frombenjaminhill at gmail dot com
StatusBogus
PackageHTML_QuickForm
PHP Version5.1.4
OSWinXP
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!