Class: \Conifer\AjaxHandler\AbstractBase (abstract)
Visibility | Function |
---|---|
public | __construct(array $request)</strong> : void Constructor. TODO decide whether to require Monolog?? |
public static | handle() : void Handle the AJAX action for the given $request Defaults to the $_REQUEST superglobal. |
public static | handle_get() : void Handle an HTTP GET request. |
public static | handle_post() : void Handle an HTTP POST request. |
protected | cookie(mixed $name)</strong> : mixed the value for the cookie param. Defaults to the empty string if not set. Get a param value from the cookie |
protected | dispatch_action() : mixed $response the result of calling the corrsponding _action method. This *should be an array. Dispatch a handler method dynamically based on the requested action |
protected | abstract execute() : array The response after handling the request Abstract method used to define the functionality when handling an AJAX request. Should return an array to be encoded in the response. |
protected | map_action(string $action, string $methodName)</strong> : Conifer\AjaxHandler\AbstractBase The current AbstractBase class instance Adds the specified action name to the action_methods array as a key, with the specified method name as the value. Used to determine the method user to handle the specified action. |
protected | param(mixed $name)</strong> : mixed the value for the request param. Defaults to the empty string if not set. Get a param value from the request |
protected | send_json_response(array $response)</strong> : void Send $response as a JSON HTTP response and close the connection. |