xajaxUserFunction. inc.php

Contains the xajaxUserFunction class

Summary
Contains the xajaxUserFunction class
Please see copyright.inc.php for a detailed description, copyright and license information.
Construct instances of this class to define functions that will be registered with the xajax request processor.
An alias to use for this function.
A string or array which defines the function to be registered.
The path and file name of the include file that contains the function.
An associative array containing call options that will be sent to the browser curing client script generation.
Constructs and initializes the xajaxUserFunction object.
Get the name of the function being referenced.
Call this to set call options for this instance.
Constructs and returns a xajaxRequest object which is capable of generating the javascript call to invoke this xajax enabled function.
Called by the xajaxPlugin that is referencing this function reference during the client script generation phase.
Called by the xajaxPlugin that references this function during the request processing phase.

xajaxUserFunction class

Please see copyright.inc.php for a detailed description, copyright and license information.

xajaxUserFunction

Construct instances of this class to define functions that will be registered with the xajax 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.

Summary
An alias to use for this function.
A string or array which defines the function to be registered.
The path and file name of the include file that contains the function.
An associative array containing call options that will be sent to the browser curing client script generation.
Constructs and initializes the xajaxUserFunction object.
Get the name of the function being referenced.
Call this to set call options for this instance.
Constructs and returns a xajaxRequest object which is capable of generating the javascript call to invoke this xajax enabled function.
Called by the xajaxPlugin that is referencing this function reference during the client script generation phase.
Called by the xajaxPlugin that references this function during the request processing phase.

Variables

sAlias

var $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.

uf

var $uf

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

sInclude

var $sInclude

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

aConfiguration

var $aConfiguration

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

Functions

xajaxUserFunction

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);

getName

function getName()

Get the name of the function being referenced.

Returns

stringthe name of the function contained within this object.

configure

function configure($sName,
$sValue)

Call this to set call options for this instance.

generateRequest

function generateRequest($sXajaxPrefix)

Constructs and returns a xajaxRequest object which is capable of generating the javascript call to invoke this xajax enabled function.

generateClientScript

function generateClientScript($sXajaxPrefix)

Called by the xajaxPlugin 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.

call

function call($aArgs = array())

Called by the xajaxPlugin 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.

This file contains detailed information regarding the xajax project, current version, copyrights, licnese and documentation.
var $sAlias
An alias to use for this function.
var $uf
A string or array which defines the function to be registered.
var $sInclude
The path and file name of the include file that contains the function.
var $aConfiguration
An associative array containing call options that will be sent to the browser curing client script generation.
function xajaxUserFunction($uf,  
$sInclude = NULL,
$aConfiguration = array())
Constructs and initializes the xajaxUserFunction object.
function getName()
Get the name of the function being referenced.
function configure($sName,
$sValue)
Call this to set call options for this instance.
function generateRequest($sXajaxPrefix)
Constructs and returns a xajaxRequest object which is capable of generating the javascript call to invoke this xajax enabled function.
Used to store and generate the client script necessary to invoke a xajax request from the browser to the server script.
function generateClientScript($sXajaxPrefix)
Called by the xajaxPlugin that is referencing this function reference during the client script generation phase.
The base class for all xajax plugins.
function call($aArgs = array())
Called by the xajaxPlugin that references this function during the request processing phase.