php rest tutorial

Php code posted by nick
created at 14 Oct 18:01, updated at 14 Oct 18:03

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$resource = array_shift($paths);
 
if ($resource == 'clients') {
    $name = array_shift($paths);
 
    if (empty($name)) {
        $this->handle_base($method);
    } else {
        $this->handle_name($method, $name);
    }
 
} else {
    // We only handle resources under 'clients'
    header('HTTP/1.1 404 Not Found');
}
336 Bytes in 5 ms with coderay