constructor xajax [line 176]
xajax xajax(
[string
$sRequestURI = ""], [string
$sWrapperPrefix = "xajax_"], [string
$sEncoding = XAJAX_DEFAULT_CHAR_ENCODING], [boolean
$bDebug = false])
|
|
Constructor. You can set some extra xajax options right away or use individual methods later to set options.
Parameters:
method autoCompressJavascript [line 918]
void autoCompressJavascript(
[string
$sJsFullFilename = NULL])
|
|
This method can be used to create a new xajax.js file out of the xajax_uncompressed.js file (which will only happen if xajax.js doesn't already exist on the filesystem).
Parameters:
method canProcessRequests [line 593]
boolean canProcessRequests(
)
|
|
Returns true if xajax can process the request, false if otherwise.
You can use this to determine if xajax needs to process the request or not.
method cleanBufferOff [line 417]
Turns off xajax's output buffer cleaning.
method cleanBufferOn [line 410]
Causes xajax to clean out all output buffers before outputting a response (default behavior).
method debugOff [line 322]
Disables debug messages for xajax (default behavior).
method debugOn [line 314]
Enables debug messages for xajax.
method decodeUTF8InputOff [line 450]
void decodeUTF8InputOff(
)
|
|
Turns off decoding the input request args from UTF-8 (default behavior).
method decodeUTF8InputOn [line 442]
void decodeUTF8InputOn(
)
|
|
Causes xajax to decode the input request args from UTF-8 to the current encoding if possible. Either the iconv or mb_string extension must be present for optimal functionality.
method errorHandlerOff [line 390]
Turns off xajax's error handling system (default behavior).
method errorHandlerOn [line 382]
Turns on xajax's error handling system so that PHP errors that occur during a request are trapped and pushed to the browser in the form of a Javascript alert.
method exitAllowedOff [line 372]
Disables xajax's default behavior of exiting immediately after processing a request and sending the response back to the browser.
method exitAllowedOn [line 363]
Enables xajax to exit immediately after processing a request and sending the response back to the browser (default behavior).
method getFlag [line 255]
Returns the value of the flag
Parameters:
method getJavascript [line 844]
string getJavascript(
[string
$sJsURI = ""], [string
$sJsFile = NULL])
|
|
Returns the xajax Javascript code that should be added to your HTML page between the
<head> </head> tags.
Usage:
<head>
...
< ?php echo $xajaxJSHead; ? >
Parameters:
method getJavascriptConfig [line 858]
string getJavascriptConfig(
)
|
|
Returns a string containing inline Javascript that sets up the xajax runtime (typically called internally by xajax from get/printJavascript).
method getJavascriptInclude [line 894]
string getJavascriptInclude(
[string
$sJsURI = ""], [string
$sJsFile = NULL])
|
|
Returns a string containing a Javascript include of the xajax.js file along with a check to see if the file loaded after six seconds (typically called internally by xajax from get/printJavascript).
Parameters:
method getRequestMode [line 605]
Returns the current request mode (XAJAX_GET or XAJAX_POST), or -1 if there is none.
method getTimeout [line 282]
Returns the xajax Javascript timeout
Tags:
method getVersion [line 203]
Returns the current xajax version.
method outputEntitiesOff [line 468]
void outputEntitiesOff(
)
|
|
Tells the response object to output special characters intact. (default behavior).
method outputEntitiesOn [line 459]
Tells the response object to convert special characters to HTML entities automatically (only works if the mb_string extension is available).
method printJavascript [line 815]
void printJavascript(
[string
$sJsURI = ""], [string
$sJsFile = NULL])
|
|
Prints the xajax Javascript header and wrapper code into your page by printing the output of the getJavascript() method. It should only be called between the
tags in your HTML page.
Remember, if you only want to obtain the result of this function, use xajax::getJavascript() instead.
Usage:
<head>
...
Parameters:
method processRequest [line 616]
method processRequests [line 629]
This is the main communications engine of xajax. The engine handles all
incoming xajax requests, calls the apporiate PHP functions (or class/object methods) and passes the XML responses back to the Javascript response handler. If your RequestURI is the same as your Web page then this function should be called before any headers or HTML has been sent.
method registerCatchAllFunction [line 549]
void registerCatchAllFunction(
string
$mFunction)
|
|
Registers a PHP function to be called when xajax cannot find the
function being called via Javascript. Because this is technically impossible when using "wrapped" functions, the catch-all feature is only useful when you're directly using the xajax.call() Javascript method. Use the catch-all feature when you want more dynamic ability to intercept unknown calls and handle them in a custom way.
Usage: $xajax->registerCatchAllFunction("myCatchAllFunction");
Parameters:
method registerExternalFunction [line 523]
void registerExternalFunction(
string
$mFunction, string
$sIncludeFile, [mixed
$sRequestType = XAJAX_POST])
|
|
Registers a PHP function to be callable through xajax which is located in some other file. If the function is requested the external file will be included to define the function before the function is called.
Usage: $xajax->registerExternalFunction("myFunction","myFunction.inc.php",XAJAX_POST);
Parameters:
method registerFunction [line 492]
void registerFunction(
mixed
$mFunction, [mixed
$sRequestType = XAJAX_POST])
|
|
Registers a PHP function or method to be callable through xajax in your
Javascript. If you want to register a function, pass in the name of that function. If you want to register a static class method, pass in an array like so: array("myFunctionName", "myClass", "myMethod") For an object instance method, use an object variable for the second array element (and in PHP 4 make sure you put an & before the variable to pass the object by reference). Note: the function name is what you call via Javascript, so it can be anything as long as it doesn't conflict with any other registered function name.
Usage: $xajax->registerFunction("myFunction"); or: $xajax->registerFunction(array("myFunctionName", &$myObject, "myMethod"));
Parameters:
method registerPreFunction [line 575]
void registerPreFunction(
string
$mFunction)
|
|
Registers a PHP function to be called before xajax calls the requested
function. xajax will automatically add the request function's response to the pre-function's response to create a single response. Another feature is the ability to return not just a response, but an array with the first element being false (a boolean) and the second being the response. In this case, the pre-function's response will be returned to the browser without xajax calling the requested function.
Usage: $xajax->registerPreFunction("myPreFunction");
Parameters:
method setCharEncoding [line 432]
void setCharEncoding(
string
$sEncoding)
|
|
Sets the character encoding for the HTTP output based on
$sEncoding, which is a string containing the character encoding to use. You don't need to use this method normally, since the character encoding for the response gets set automatically based on the XAJAX_DEFAULT_CHAR_ENCODING constant. Usage: $xajax->setCharEncoding("utf-8");
Parameters:
method setFlag [line 239]
void setFlag(
string
$name, boolean
$value)
|
|
Sets a flag (boolean true or false). Available flags with their defaults are as follows:
- debug: false
- statusMessages: false
- waitCursor: true
- exitAllowed: true
- errorHandler: false
- cleanBuffer: false
- decodeUTF8Input: false
- outputEntities: false
Parameters:
method setFlags [line 214]
void setFlags(
array
$flags)
|
|
Sets multiple flags based on the supplied associative array (see
xajax::setFlag() for flag names)
Parameters:
method setLogFile [line 401]
void setLogFile(
$sFilename)
|
|
Specifies a log file that will be written to by xajax during a request (used only by the error handling system at present). If you don't invoke this method, or you pass in "", then no log file will be written to.
Usage: $xajax->setLogFile("/xajax_logs/errors.log");
Parameters:
method setRequestURI [line 294]
void setRequestURI(
string
$sRequestURI)
|
|
Sets the URI to which requests will be made.
Usage: $xajax->setRequestURI("http://www.xajaxproject.org");
Parameters:
method setTimeout [line 272]
void setTimeout(
integer
$iTimeout)
|
|
Sets the timeout before xajax notifies the client that xajax has not been loaded
Usage: $xajax->setTimeout(6000);
Parameters:
method setWrapperPrefix [line 306]
void setWrapperPrefix(
string
$sPrefix)
|
|
Sets the prefix that will be appended to the Javascript wrapper functions (default is "xajax_").
Parameters:
method statusMessagesOff [line 338]
void statusMessagesOff(
)
|
|
Disables messages in the browser's status bar for xajax (default behavior).
method statusMessagesOn [line 330]
Enables messages in the browser's status bar for xajax.
method waitCursorOff [line 354]
Disables the wait cursor to be displayed in the browser.
method waitCursorOn [line 346]
Enables the wait cursor to be displayed in the browser (default behavior).