blob: f766398220c0da8704f3f4ecf907275d26c50568 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<?php
class BaseController {
public static function invoke() {
switch ($_SERVER['REQUEST_METHOD']) {
case 'POST':
static::post();
break;
case 'PUT':
static::put();
break;
case 'DELETE':
static::delete();
break;
default:
static::get();
break;
}
}
protected static function get() {
echo 'GET method not implemented!';
}
protected static function post() {
echo 'POST method not implemented!';
}
protected static function put() {
echo 'PUT method not implemented!';
}
protected static function delete() {
echo 'DELETE method not implemented!';
}
}
|