API Handler | Summit

ApiHandler is used to assist in accessing your api. The class can output results in a php array, json, xml or nothing at all.


Configuration

Below are the configuration variables for the API class.


Option Description
available_api An array of the available APIs and their methods.
$config['available_api'] = array('API_NAME' => array('Method1', 'Method2');


Methods


Init($return_method)

The Init method will initialize the ApiHandler and set the method that output is handled.

Usage:
ApiHandler::Init('xml');


Run($class, $function, $arguments)

The Run method runs the function inside the class you specified along with the given arguments.

Usage:
ApiHandler::Init('array');
$check_name = ApiHandler::Run('User', 'UsernameTaken', array('username' => 'Jeff'));








Featured Products