Class: xajaxResponse
Source Location: /pem-includes/xajax/xajax_core/xajaxResponse.inc.php
The xajaxResponse class is used to create responses to be sent back to your Web page. A response contains one or more command messages for updating your page.
|
|
|
Class Details
Class Variables
Class Methods
constructor xajaxResponse [line 94]
xajaxResponse xajaxResponse(
[string
$sEncoding = XAJAX_DEFAULT_CHAR_ENCODING], [boolean
$bOutputEntities = false])
|
|
The constructor's main job is to set the character encoding for the response. Note: to change the character encoding for all of the responses, set the XAJAX_DEFAULT_ENCODING constant before you instantiate xajax.
Parameters:
method addCommand [line 800]
void addCommand(
array
$aAttributes, mixed
$mData)
|
|
Adds a commmand to the array of all commands
Parameters:
method addEvent [line 486]
void addEvent(
string
$sTarget, string
$sEvent, string
$sScript)
|
|
Adds an event command message to the response. Usage: $objResponse->addEvent("contentDiv", "onclick", "alert(\'Hello World\');");
Parameters:
method addHandler [line 502]
void addHandler(
string
$sTarget, string
$sEvent, string
$sHandler)
|
|
Adds a handler command message to the response. Usage: $objResponse->addHandler("contentDiv", "onclick", "content_click");
Parameters:
method addPluginCommand [line 731]
Used internally by the response plugin system
Parameters:
method alert [line 270]
void alert(
string
$sMsg)
|
|
Adds an alert command message to the response. Usage: $objResponse->alert("This is important information");
Parameters:
method append [line 205]
void append(
string
$sTarget, string
$sAttribute, string
$sData)
|
|
Adds an append command message to the response. Usage: $objResponse->append("contentDiv", "innerHTML", "Some New Text");
Parameters:
method assign [line 189]
void assign(
string
$sTarget, string
$sAttribute, string
$sData)
|
|
Adds an assign command message to the response. Usage: $objResponse->assign("contentDiv", "innerHTML", "Some Text");
Parameters:
method call [line 345]
void call(
string
$sFunc, mixed
$args,...)
|
|
Adds a Javascript function call command message to the response. Usage: $objResponse->call("myJSFunction", "arg 1", "arg 2", 12345);
Parameters:
method clear [line 257]
void clear(
string
$sTarget, string
$sAttribute)
|
|
Adds a clear command message to the response. Usage: $objResponse->clear("contentDiv", "innerHTML");
Parameters:
method confirmCommands [line 173]
void confirmCommands(
integer
$iCmdNumber, string
$sMessage)
|
|
Adds a confirm commands command message to the response. Usage: $objResponse->confirmCommands(1, "Do you want to preview the new data?");
Parameters:
method create [line 377]
void create(
string
$sParent, string
$sTag, string
$sId, [string
$sType = ''])
|
|
Adds a create element command message to the response. Usage: $objResponse->create("parentDiv", "h3", "myid");
Parameters:
method createInput [line 433]
void createInput(
string
$sParent, string
$sType, string
$sName, string
$sId)
|
|
Adds a create input command message to the response. Usage: $objResponse->createInput("form1", "text", "username", "input1");
Parameters:
method getCommandCount [line 684]
integer getCommandCount(
)
|
|
Returns the number of commands current in the response
method getContentType [line 629]
Returns the content type of the response (typically "text/xml").
method getOutput [line 640]
Returns the output of the response suitable for sending to a Web browser (i. e., XML or JSON)
method includeCSS [line 572]
void includeCSS(
string
$sFileName)
|
|
Adds an include CSS command message to the response. Usage: $objResponse->includeCSS("stylesheet.css");
Parameters:
method includeScript [line 532]
void includeScript(
string
$sFileName)
|
|
Adds an include script command message to the response. Usage: $objResponse->includeScript("functions.js");
Parameters:
method includeScriptOnce [line 545]
void includeScriptOnce(
string
$sFileName)
|
|
Adds an include script once command message to the response. Usage: $objResponse->includeScriptOnce("functions2.js");
Parameters:
method insert [line 398]
void insert(
string
$sBefore, string
$sTag, string
$sId)
|
|
Adds a insert element command message to the response. Usage: $objResponse->insert("childDiv", "h3", "myid");
Parameters:
method insertAfter [line 414]
void insertAfter(
string
$sAfter, string
$sTag, string
$sId)
|
|
Adds a insert element command message to the response. Usage: $objResponse->insertAfter("childDiv", "h3", "myid");
Parameters:
method insertInput [line 452]
void insertInput(
string
$sBefore, string
$sType, string
$sName, string
$sId)
|
|
Adds an insert input command message to the response. Usage: $objResponse->insertInput("input5", "text", "username", "input1");
Parameters:
method insertInputAfter [line 471]
void insertInputAfter(
string
$sAfter, string
$sType, string
$sName, string
$sId)
|
|
Adds an insert input command message to the response. Usage: $objResponse->insertInputAfter("input7", "text", "email", "input2");
Parameters:
method loadCommands [line 700]
void loadCommands(
mixed
$mCommands, [
$bBefore = false])
|
|
Adds the commands of the provided response to this response object Usage:
return $objResponse2;
Parameters:
method plugin [line 137]
void &plugin(
string
$sName)
|
|
Provides access to the xajaxResponse plugin system. If you use PHP 4 or 5, pass the plugin name as the first argument, the plugin's method name as the second argument, and subsequent arguments (if any) after that. Optionally, if you use PHP 5, you can pass just the plugin name as the first argument and the plugin object will be returned which you can use to call the appropriate method.
Parameters:
method prepend [line 222]
void prepend(
string
$sTarget, string
$sAttribute, string
$sData)
|
|
Adds an prepend command message to the response. Usage: $objResponse->prepend("contentDiv", "innerHTML", "Some Starting Text");
Parameters:
method redirect [line 283]
void redirect(
string
$sURL, [
$iDelay = 0])
|
|
Uses the addScript() method to add a Javascript redirect to another URL. Usage: $objResponse->redirect("http://www.xajaxproject.org");
Parameters:
method remove [line 360]
void remove(
string
$sTarget)
|
|
Adds a remove element command message to the response. Usage: $objResponse->remove("Div2");
Parameters:
method removeCSS [line 585]
void removeCSS(
string
$sFileName)
|
|
Adds a remove CSS command message to the response. Usage: $objResponse->removeCSS("stylesheet.css");
Parameters:
method removeHandler [line 519]
void removeHandler(
string
$sTarget, string
$sEvent, string
$sHandler)
|
|
Adds a remove handler command message to the response. Usage: $objResponse->removeHandler("contentDiv", "onclick", "content_click");
Parameters:
method removeScript [line 560]
void removeScript(
string
$sFileName, [string
$sUnload = ''])
|
|
Removes a script reference so the browser can unload the .js file Usage: $objResponse->removeScript("functions2.js");
Parameters:
method replace [line 240]
void replace(
string
$sTarget, string
$sAttribute, string
$sSearch, string
$sData)
|
|
Adds a replace command message to the response. Usage: $objResponse->replace("contentDiv", "innerHTML", "text", "<b>text</b>");
Parameters:
method script [line 331]
void script(
string
$sJS)
|
|
Adds a Javascript command message to the response. Usage: $objResponse->script("var x = prompt('get some text');");
Parameters:
method setCharEncoding [line 110]
void setCharEncoding(
string
$sEncoding)
|
|
Sets the character encoding for the response 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.
Parameters:
method setOutputEntities [line 121]
void setOutputEntities(
$bOption)
|
|
If true, tells the response object to convert special characters to HTML entities automatically (only works if the mb_string extension is available).
Parameters:
method setReturnValue [line 620]
void setReturnValue(
$value)
|
|
Stores a value (or array) that will be passed back as part of the response.
Parameters:
method waitFor [line 611]
void waitFor(
string
$script)
|
|
Adds a wait for command message to the response Usage: $objResponse->waitFor('myVariable == "myValue"');
Parameters:
method waitForCSS [line 597]
Adds a wait For CSS command message to the response. Usage: $objResponse->waitForCSS();
method _getReturnValue [line 670]
returns an xml encoded string containing the return value to send back as part of the response, if a return value was set, otherwise and empty string
method __get [line 159]
void __get(
string
$sPluginName)
|
|
Internal function for PHP5 only. Used to permit plugins to be called as if they were native member variables of the xajaxResponse class. PHP5 Usage: $objResponse->myPlugin->myPluginMethod("param1", "param2");
Parameters:
|
|