Summary Files Commits Branches @commit @diff @stats
path: root / src / controllers / BaseController.php
blob: fd4bedd0ffe41eb6a48a345cfc472c00413f90c4 (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
<?php
abstract 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;
		}
	}

	abstract protected static function get();

	abstract protected static function post();

	abstract protected static function put();

	abstract protected static function delete();
}