Re: QuickForm: Custom rule in class

From: Date: Sun, 13 Apr 2008 18:13:28 +0000
Subject: Re: QuickForm: Custom rule in class
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-28795@lists.php.net to get a copy of this message
Try this: (this is how I always do it in my scripts and it works) $form->registerRule('checkValue', 'callback', 'myRule', $this) Where the $form must be your QF object Mark Steudel wrote:
Hi, I'm creating a custom rule in QuickForm inside of a class I tried doing the following class SomeClass {
           function myRule( $name, $value, $options ) {
           }
           function myForm() {
                       $this->registerRule( 'checkValue', 'callback',
array( &$this, 'myRule' ) );
           }
} But I'm getting the following error: Fatal error: Function name must be a string in C:\wamp\php\PEAR\HTML\QuickForm\Rule\Callback.php on line 79 Any help would be appreciated. Thanks, Mark
-- Open Source ALL content management with streaming video http://wiki.sharedlog.com

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