Skip to content

Instantly share code, notes, and snippets.

@dubrod
Created January 8, 2013 15:02
Show Gist options
  • Save dubrod/4484444 to your computer and use it in GitHub Desktop.
Save dubrod/4484444 to your computer and use it in GitHub Desktop.
Setting Up and API in PHP for those of us awesome developers using SADO. http://www.shayanderson.com/projects/sado-php-orm.htm
<?
//bootstrap
require_once 'lib/Sado/sado.bootstrap.php';
//pre-qualify
if(function_exists($_GET['method'])){
$_GET['method']();
}
//methods
function getAllUsers(){
//connect
$db = &SadoFactory::getInstance();
$users = $db->selectBuilder()
->select('*')
->from('users')
->get();
$users = json_encode($users);
echo($users);
}
?>
@dubrod
Copy link
Author

dubrod commented Jan 8, 2013

This is my first API. I learned the basics from this YouTube Video. Very quick easy script for sharing your Public data. https://www.youtube.com/watch?v=F5pXxS0y4bg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment