Summary Files Commits Branches @commit @diff @stats
path: root / src / controllers / BaseController.php
diff options
context:
space:
mode:
1 files changed, 36 insertions, 0 deletions
-rw-r--r--src/controllers/BaseController.php36
diff --git a/src/controllers/BaseController.php b/src/controllers/BaseController.php
new file mode 100644
index 0000000..2c2a647
--- /dev/null
+++ b/src/controllers/BaseController.php
@@ -0,0 +1,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!";
+ }
+}