| Constructor | Description |
| PHPLiveX($functions) | Starts to handle ajax requests. Exports php functions for ajax.
$functions parameter: Optional. Its value is function names (if more than 1, seperated by commas); |
| Method | Description |
| Export("functionNames,...") | Exports the functions for ajax. Can only be called over run method.
Parameter Value: Function names (if more than 1, seperated by commas); |
| ExportClassFunctions("objectName->methodName,...") | Exports class functions for ajax. Can only be called over run method.
Parameter Value: objectName (like myObject in "$myObject = new myClass();"). methodName is name of the class function. (if more than 1, seperated by commas); |
| ExportClass("objectNames,...") | Exports all functions of the classes for ajax. Can only be called over run method.
Parameter Value: Object names (if more than 1, seperated by commas); |
| Run() | Creates javascript codes to handle ajax requests. Must be called between script tags |
<?
class myClass(){
var $Text;
function myClass($text){
$this->Text = $text;
}
function setText(){
return $this->Text;
}
}
$test = myClass("it's very easy-to-use");
$plx->ExportClassFunctions("test->setText");
//OR
$plx->ExportClass("test"); // may be used.
?>
| Parameter | Description |
| type | Can take only one value "r". If you want to get returned value of the function (e.g. give the value to a variable). And if this parameter is used, the others cannot be used. Note that if this parameter is used, the ajax request runs synchronously. (During the process, no other function runs.) |
| target | Takes the ID value of a DOM element and returned value of the function is printed to its innerHTML. |
| mode | Its default value is "rw"(rewrite) which means rewriting the value to the target. If you use "aw" (append), the value is appended to the initial innerHTML of target. |
| preload | Can take the ID value of a DOM element used for preload. It must be hidden(style="visibility:hidden") initially. During the process, the foregoing element is made visible and then hidden when the process finishes. Note that this parameter can not be used with type together. |
| method | Can take "post" and "get" values. These are the http-methods of the xmlhttp request. Default value is get. Added in version 2.1. |