[QF] Question regarding registration of rules

From: Date: Wed, 07 Jan 2004 12:55:08 +0000
Subject: [QF] Question regarding registration of rules
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-10028@lists.php.net to get a copy of this message
Hi there Is there any possibility to add a object as my defined rule ? I have a class and i want to use a function that's in that class to validate from in a few forms ( so ofcoz it's best to have the function in one place for better update :) ) This function works if a take it out of the class and have it with each form ... But if i try $form->registerRule('userexists', 'callback', '$user->userExists'); then i just get a error Fatal error: Call to undefined function: $user->userexists() in /home/dufuz/public_html/testing/pear/HTML/QuickForm/Rule/Callback.php on line 70 And i asume by the error that callback doesn't support objects :) But is there any way around this ?

« previous php.pear.general (#10028) next »