Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // do NOT include validate session...the validation is done in the
- // constuctor of AjaxResponse
- //
- require_once(dirname(__FILE__) . "/../../core/globalSettings.php");
- $ajaxResponse = new AjaxResponse($_POST);
- switch ($ajaxResponse->getMethod()) {
- case "your method" :
- //
- // YOUR CODE:
- //
- // You could read a parameter passed from the client
- //
- $param = $ajaxResponse->getParameter("key");
- //
- // YOUR CODE:
- //
- // You could create an object to be returned to the client
- // $resultObj MUST BE AN ASSOCIATIVE ARRAY OR AN OBJECT
- //
- // $resultObj = ...
- // $ajaxResponse->setResult($resultObj);
- $ajaxResponse->setSuccess(true);
- break;
- default:
- $ajaxResponse->setSuccess(false);
- $ajaxResponse->setMessage(_mb("An unknown error occured."));
- break;
- }
- $ajaxResponse->send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement