-
Notifications
You must be signed in to change notification settings - Fork 0
Server-side API producer
License
kimor79/api_producer
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Server-side functions for producing API output, mainly for YUI consumers (eg datatable) Basic flow: $required = array( 'key1' => 'digit', 'key2' => NULL, ); $optional = array( 'key3' => 'bool', ); $sanitize = array( 'key2' => 'convertcase', ); $api->setParameters(); $input = $api->setInput($_POST); $errors = $api->validateInput($input, $required, $optional); if(!empty($errors)) { $api->showOutput(array(), 0, '400', implode("\n", $errors)); exit(0); } $input = $api->sanitizeInput($input); ... // populate $records $api->sendHeaders(); $api->showOutput($records, $total_records);
About
Server-side API producer
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published