Xajax 0.2: Tips and Tricks: return $objResponse;
Xajax 0.2: Tips and Tricks: return $objResponse;
Starting with xajax 0.2, you now have the option of returning your xajaxResponse object directly from functions registered with xajax instead of having to call the getXML() method every time and return the results.
Note: You will still be able to call other functions using the loadXML() method if they return the $objResponse object instead of the XML string.
[edit] Previous to version 0.2
function myFunction() { $objResponse = new xajaxResponse(); $objResponse->addAlert("Hello World!"); return $objResponse->getXML(); }
[edit] Version 0.2 and above
function myFunction() { $objResponse = new xajaxResponse(); $objResponse->addAlert("Hello World!"); return $objResponse; }