function xajaxUserFunction( | $uf, | | | | $sInclude | = | NULL, | | $aConfiguration | = | array() | ) |
|
Constructs and initializes the xajaxUserFunction object.
$uf | (mixed): A function specification in one of the following formats: |
- a three element array: (string) Alternate function name: when a method of a class has the same name as another function in the system, you can provide an alias to help avoid collisions. (object or class name) Class: the name of the class or an instance of the object which contains the function to be called. (string) Method: the name of the method that will be called.
- a two element array: (object or class name) Class: the name of the class or an instance of the object which contains the function to be called. (string) Method: the name of the method that will be called.
- a string: the name of the function that is available at global scope (not in a class.
$sInclude | (string, optional): The path and file name of the include file that contains the class or function to be called. |
$aConfiguration | (array, optional): An associative array of call options that will be used when sending the request from the client. |
Examples
$myFunction = array(‘alias’, ‘myClass’, ‘myMethod’); $myFunction = array(‘alias’, &$myObject, ‘myMethod’); $myFunction = array(‘myClass’, ‘myMethod’); $myFunction = array(&$myObject, ‘myMethod’); $myFunction = ‘myFunction’;
$myUserFunction = new xajaxUserFunction($myFunction, ‘myFile.inc.php’, array( ‘method’ => ‘get’, ‘mode’ => ‘synchronous’ ));
$xajax->register(XAJAX_FUNCTION, $myUserFunction);