blob: 2c2a6478061b85bf1a10964292c821a654103acb (
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
36
|
<?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!";
}
}
|