PHP Class xajaxCometFunction

Construct instances of this class to define functions that will be registered with the request processor. This class defines the parameters that are needed for the definition of a xajax enabled function. While you can still specify functions by name during registration, it is advised that you convert to using this class when you wish to register external functions or to specify call options as well.
ファイルを表示 Open project: xajax/xajax

Public Properties

Property Type Description
$aConfiguration An associative array containing call options that will be sent to the browser curing client script generation.
$sAlias An alias to use for this function. This is useful when you want to call the same xajax enabled function with a different set of call options from what was already registered.
$sInclude The path and file name of the include file that contains the function.
$uf A string or array which defines the function to be registered.

Public Methods

Method Description
call ( $aArgs = [] ) * Function: call
configure ( $sName, $sValue ) * Function: configure
generateClientScript ( $sXajaxPrefix ) * Function: generateClientScript
generateRequest ( $sXajaxPrefix ) * Function: generateRequest
getName ( ) * Function: getName
xajaxCometFunction ( $uf, $sInclude = NULL, $aConfiguration = [] ) * Function: xajaxCometFunction

Method Details

call() public method

Called by the that references this function during the request processing phase. This function will call the specified function, including an external file if needed and passing along the specified arguments.
public call ( $aArgs = [] )

configure() public method

Call this to set call options for this instance.
public configure ( $sName, $sValue )

generateClientScript() public method

Called by the that is referencing this function reference during the client script generation phase. This function will generate the javascript function stub that is sent to the browser on initial page load.
public generateClientScript ( $sXajaxPrefix )

generateRequest() public method

Constructs and returns a object which is capable of generating the javascript call to invoke this xajax enabled function.
public generateRequest ( $sXajaxPrefix )

getName() public method

Get the name of the function being referenced. Returns: string - the name of the function contained within this object.
public getName ( )

xajaxCometFunction() public method

Constructs and initializes the 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 xajaxCometFunction($myFunction, 'myFile.inc.php', array( 'method' => 'get', 'mode' => 'synchronous' )); $xajax->register(XAJAX_FUNCTION, $myUserFunction);
public xajaxCometFunction ( $uf, $sInclude = NULL, $aConfiguration = [] )

Property Details

$aConfiguration public_oe property

An associative array containing call options that will be sent to the browser curing client script generation.
public $aConfiguration

$sAlias public_oe property

An alias to use for this function. This is useful when you want to call the same xajax enabled function with a different set of call options from what was already registered.
public $sAlias

$sInclude public_oe property

The path and file name of the include file that contains the function.
public $sInclude

$uf public_oe property

A string or array which defines the function to be registered.
public $uf