It ain't easy - being cheesy
Sleepy is an experimental RESTful framework, the uniqueness comes in the form of annotations. Relying on a specified format in the doc comments sleepy is able to parse, locate, and instantiate a wide range of annotations. Annotations themselves are plugins allowing third-party developers the ability to implement new and exciting functionality whenever!
Annotations in sleepy can be placed on functions or methods of a class; the choice is yours.
class Nue {
/**
* @Route(GET, /)
*/
public function index() {
echo 'Index!';
}
/**
* @Route(GET, /slug/:slug, :slug > [0-9a-z]*)
*/
public function slug($slug) {
echo 'SlugValue: ' . $slug . '</br>';
}
/**
* @Route(GET, /params/:param/:paramjam, :param > [a-zA-Z]{2,4}, :paramjam > [0-9]*)
*/
public function params($param, $paramjam) {
echo 'ParamValue: ' . $param . '</br>';
echo 'ParamJamValue: ' . $paramjam . '</br>';
}
}
/**
* @Route(POST, /login)
*/
function login() {
return $_POST['password'] = 'password';
}