RE: [PEAR] QuickForm: Custom rule in class
| From: | Mark Steudel | Date: | Sun, 13 Apr 2008 18:14:57 +0000 |
| Subject: | RE: [PEAR] QuickForm: Custom rule in class | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-28796@lists.php.net to get a copy of this message | ||
Sweet thanks will try that out.
-----Original Message-----
From: Dmitri [mailto:email12@sharedlog.com]
Sent: Sunday, April 13, 2008 11:13 AM
To: Mark Steudel
Cc: pear-general@lists.php.net
Subject: Re: [PEAR] QuickForm: Custom rule in class
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