PHP Class xajaxEvent

A container class which holds a reference to handler functions and configuration options associated with a registered event.
Show file Open project: xajax/xajax Class Usage Examples

Public Methods

Method Description
__construct ( $sName ) * Function: xajaxEvent
addHandler ( $xuf ) * Function: addHandler
configure ( $sName, $mValue ) * Function: configure
fire ( $aArgs ) * Function: fire
generateClientScript ( $sXajaxPrefix, $sEventPrefix ) * Function: generateClientScript
generateRequest ( $sXajaxPrefix, $sEventPrefix ) * Function: generateRequest
getName ( ) * Function: getName

Method Details

__construct() public method

Construct and initialize this object.
public __construct ( $sName )

addHandler() public method

Adds a object to the list of handlers that will be fired when the event is triggered.
public addHandler ( $xuf )

configure() public method

Sets/stores configuration options that will be used when generating the client script that is sent to the browser.
public configure ( $sName, $mValue )

fire() public method

Called by the when the event has been triggered.
public fire ( $aArgs )

generateClientScript() public method

Generates a block of javascript code that declares a stub function that can be used to easily trigger the event from the browser.
public generateClientScript ( $sXajaxPrefix, $sEventPrefix )

generateRequest() public method

Generates a object that corresponds to the event so that the client script can easily invoke this event. sXajaxPrefix - (string): The prefix that will be prepended to the client script stub function associated with this event. sEventPrefix - (string): The prefix prepended to the client script function stub and script.
public generateRequest ( $sXajaxPrefix, $sEventPrefix )

getName() public method

Returns the name of the event. Returns: string - the name of the event.
public getName ( )