QF $process() - does callback have to be a string?
| From: | Erik Heerlein | Date: | Wed, 03 Nov 2004 22:26:02 +0000 |
| Subject: | QF $process() - does callback have to be a string? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-15323@lists.php.net to get a copy of this message | ||
Instead of using a string to specify the callback for a function in the same scope as the $form object,
$form->process('doSomething');
is there a way to use a method of an object from an included class? Like,
$form->process($object->doSomething);
The function I want to use to process the form data is in another class and not in the same scope as the $form object but it seems that the process() method only accepts a string for a parameter. I can always do
$form->process('doSomething');
function doSomething($_form_data)
{
include_once('class.php');
$object = new class();
$object->doSomething($_form_data);
}
but I was wondering if there was a better way.
- Erik Heerlein