Topic: How to register a single public function of a class

i have a class
class foo {
  public function fkt1 () { }

  public  function fkt2 () { }
}

and i would like to register only fkt2 as xajax-function and i don't want to use XAJAX_CALLABLE_OBJECT;

$foo = new foo();
$xajax = new xajax('ajax.server.php');
$xajax->configure('javascript URI', 'lib/xajax/');
$xajax->register(XAJAX_CALLABLE_OBJECT,$foo);

how can i register only a single public function of a class?

Re: How to register a single public function of a class

See this post:

http://community.xajaxproject.org/topic … method-05/

Ed

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: How to register a single public function of a class

thank you. i did something like this and it works:

class foo {
  public function fkt1 () { }
  public  function fkt2 () { }
}

$foo = new foo();
$xajax = new xajax('ajax.server.php');
$xajax->configure('javascript URI', 'lib/xajax/');
$xajax->register(XAJAX_FUNCTION, new xajaxUserFunction(array($foo, 'fkt2')));