Skip to content

Instantly share code, notes, and snippets.

@tryvin
Last active November 30, 2015 18:43
Show Gist options
  • Save tryvin/5c1fc37096b575d63c2a to your computer and use it in GitHub Desktop.
Save tryvin/5c1fc37096b575d63c2a to your computer and use it in GitHub Desktop.
Restful model
<?php
class MyRestfulHandler extends BaseRestfulHandler {
/**
* @url GET /users
*/
public function getusers() {
return $userList;
}
/**
* @url POST /users/new
*/
public function newUser() {
$userData = $this->server->data;
}
/**
* @url DELETE /user/$userId
*/
public function deleteUser($userId) {
return $this->model->deleteUser($userId);
}
// Well, you got it!
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment